infcmd.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792
  1. /* Memory-access and commands for inferior process, for GDB.
  2. Copyright (C) 1986, 1987 Free Software Foundation, Inc.
  3. GDB is distributed in the hope that it will be useful, but WITHOUT ANY
  4. WARRANTY. No author or distributor accepts responsibility to anyone
  5. for the consequences of using it or for whether it serves any
  6. particular purpose or works at all, unless he says so in writing.
  7. Refer to the GDB General Public License for full details.
  8. Everyone is granted permission to copy, modify and redistribute GDB,
  9. but only under the conditions described in the GDB General Public
  10. License. A copy of this license is supposed to have been given to you
  11. along with GDB so you can know your rights and responsibilities. It
  12. should be in a file named COPYING. Among other things, the copyright
  13. notice and this notice must be preserved on all copies.
  14. In other words, go ahead and share GDB, but don't try to stop
  15. anyone else from sharing it farther. Help stamp out software hoarding!
  16. */
  17. #include "defs.h"
  18. #include "initialize.h"
  19. #include "symtab.h"
  20. #include "param.h"
  21. #include "frame.h"
  22. #include "inferior.h"
  23. #include "environ.h"
  24. #include "value.h"
  25. #include <stdio.h>
  26. #include <signal.h>
  27. #include <sys/param.h>
  28. extern char *sys_siglist[];
  29. #define ERROR_NO_INFERIOR \
  30. if (inferior_pid == 0) error ("The program is not being run.");
  31. /* String containing arguments to give to the program,
  32. with a space added at the front. Just a space means no args. */
  33. static char *inferior_args;
  34. /* Pid of our debugged inferior, or 0 if no inferior now. */
  35. int inferior_pid;
  36. /* Last signal that the inferior received (why it stopped). */
  37. int stop_signal;
  38. /* Address at which inferior stopped. */
  39. CORE_ADDR stop_pc;
  40. /* Stack frame when program stopped. */
  41. FRAME stop_frame;
  42. /* Number of breakpoint it stopped at, or 0 if none. */
  43. int stop_breakpoint;
  44. /* Nonzero if stopped due to a step command. */
  45. int stop_step;
  46. /* Nonzero if stopped due to completion of a stack dummy routine. */
  47. int stop_stack_dummy;
  48. /* Range to single step within.
  49. If this is nonzero, respond to a single-step signal
  50. by continuing to step if the pc is in this range. */
  51. CORE_ADDR step_range_start; /* Inclusive */
  52. CORE_ADDR step_range_end; /* Exclusive */
  53. /* Stack frame address as of when stepping command was issued.
  54. This is how we know when we step into a subroutine call,
  55. and how to set the frame for the breakpoint used to step out. */
  56. CORE_ADDR step_frame;
  57. /* 1 means step over all subroutine calls.
  58. -1 means step over calls to undebuggable functions. */
  59. int step_over_calls;
  60. /* If stepping, nonzero means step count is > 1
  61. so don't print frame next time inferior stops
  62. if it stops due to stepping. */
  63. int step_multi;
  64. /* Environment to use for running inferior,
  65. in format described in environ.h. */
  66. struct environ *inferior_environ;
  67. CORE_ADDR read_pc ();
  68. START_FILE
  69. int
  70. have_inferior_p ()
  71. {
  72. return inferior_pid != 0;
  73. }
  74. static void
  75. set_args_command (args)
  76. char *args;
  77. {
  78. free (inferior_args);
  79. if (!args) args = "";
  80. inferior_args = concat (" ", args, "");
  81. }
  82. static void
  83. run_command (args, from_tty)
  84. char *args;
  85. int from_tty;
  86. {
  87. register int pid;
  88. extern char **environ;
  89. register int i;
  90. char *exec_file;
  91. char *allargs;
  92. extern int sys_nerr;
  93. extern char *sys_errlist[];
  94. extern int errno;
  95. dont_repeat ();
  96. if (inferior_pid)
  97. {
  98. if (query ("The program being debugged has been started already.\n\
  99. Start it from the beginning? "))
  100. kill_inferior ();
  101. else
  102. error ("Program already started.");
  103. }
  104. if (args)
  105. set_args_command (args);
  106. exec_file = (char *) get_exec_file ();
  107. if (from_tty)
  108. {
  109. printf ("Starting program: %s%s\n",
  110. exec_file, inferior_args);
  111. fflush (stdout);
  112. }
  113. allargs = concat ("exec ", exec_file, inferior_args);
  114. pid = vfork ();
  115. if (pid < 0)
  116. perror_with_name ("vfork");
  117. if (pid == 0)
  118. {
  119. /* Run inferior in a separate process group. */
  120. setpgrp (getpid (), getpid ());
  121. /* Not needed on Sun, at least, and loses there
  122. because it clobbers the superior. */
  123. /*??? signal (SIGQUIT, SIG_DFL);
  124. signal (SIGINT, SIG_DFL); */
  125. ptrace (0);
  126. execle ("/bin/sh", "sh", "-c", allargs, 0,
  127. environ_vector (inferior_environ));
  128. fprintf (stderr, "Cannot exec /bin/sh: %s.\n",
  129. errno < sys_nerr ? sys_errlist[errno] : "unknown error");
  130. fflush (stderr);
  131. _exit (0177);
  132. }
  133. inferior_pid = pid;
  134. free (allargs);
  135. clear_proceed_status ();
  136. start_inferior ();
  137. }
  138. static void
  139. cont_command (proc_count_exp, from_tty)
  140. char *proc_count_exp;
  141. int from_tty;
  142. {
  143. ERROR_NO_INFERIOR;
  144. clear_proceed_status ();
  145. /* If have argument, set proceed count of breakpoint we stopped at. */
  146. if (stop_breakpoint && proc_count_exp)
  147. {
  148. set_ignore_count (stop_breakpoint,
  149. parse_and_eval_address (proc_count_exp) - 1,
  150. from_tty);
  151. if (from_tty)
  152. printf (" ");
  153. }
  154. if (from_tty)
  155. printf ("Continuing.\n");
  156. proceed (-1, -1, 0);
  157. }
  158. /* Step until outside of current statement. */
  159. static void step_1 ();
  160. static void
  161. step_command (count_string)
  162. {
  163. step_1 (0, 0, count_string);
  164. }
  165. /* Likewise, but skip over subroutine calls as if single instructions. */
  166. static void
  167. next_command (count_string)
  168. {
  169. step_1 (1, 0, count_string);
  170. }
  171. /* Likewise, but step only one instruction. */
  172. static void
  173. stepi_command (count_string)
  174. {
  175. step_1 (0, 1, count_string);
  176. }
  177. static void
  178. nexti_command (count_string)
  179. {
  180. step_1 (1, 1, count_string);
  181. }
  182. static void
  183. step_1 (skip_subroutines, single_inst, count_string)
  184. int skip_subroutines;
  185. int single_inst;
  186. char *count_string;
  187. {
  188. register int count = 1;
  189. ERROR_NO_INFERIOR;
  190. count = count_string ? parse_and_eval_address (count_string) : 1;
  191. for (; count > 0; count--)
  192. {
  193. clear_proceed_status ();
  194. step_frame = get_current_frame ();
  195. if (! single_inst)
  196. {
  197. find_pc_line_pc_range (stop_pc, &step_range_start, &step_range_end);
  198. if (step_range_end == 0)
  199. {
  200. terminal_ours ();
  201. error ("Current function has no line number information.");
  202. }
  203. }
  204. else
  205. {
  206. /* Say we are stepping, but stop after one insn whatever it does.
  207. Don't step through subroutine calls even to undebuggable functions. */
  208. step_range_start = step_range_end = 1;
  209. if (!skip_subroutines)
  210. step_over_calls = 0;
  211. }
  212. if (skip_subroutines)
  213. step_over_calls = 1;
  214. step_multi = (count > 1);
  215. proceed (-1, -1, 1);
  216. if (! stop_step)
  217. break;
  218. }
  219. }
  220. /* Continue program at specified address. */
  221. static void
  222. jump_command (arg, from_tty)
  223. char *arg;
  224. int from_tty;
  225. {
  226. register CORE_ADDR addr;
  227. struct symtab_and_line sal;
  228. ERROR_NO_INFERIOR;
  229. if (!arg)
  230. error_no_arg ("starting address");
  231. sal = decode_line_spec (arg, 1);
  232. if (sal.symtab == 0 && sal.pc == 0)
  233. error ("No source file has been specified.");
  234. if (sal.pc == 0)
  235. sal.pc = find_line_pc (sal.symtab, sal.line);
  236. {
  237. struct symbol *fn = get_frame_function (get_current_frame ());
  238. struct symbol *sfn = find_pc_function (sal.pc);
  239. if (fn != 0 && sfn != fn
  240. && ! query ("That is not in function %s. Continue there? ",
  241. sal.line, SYMBOL_NAME (fn)))
  242. error ("Not confirmed.");
  243. }
  244. if (sal.pc == 0)
  245. error ("No line %d in file \"%s\".", sal.line, sal.symtab->filename);
  246. addr = sal.pc;
  247. clear_proceed_status ();
  248. if (from_tty)
  249. printf ("Continuing at 0x%x.\n", addr);
  250. proceed (addr, 0, 0);
  251. }
  252. /* Continue program giving it specified signal. */
  253. static void
  254. signal_command (signum_exp, from_tty)
  255. char *signum_exp;
  256. int from_tty;
  257. {
  258. register int signum;
  259. dont_repeat (); /* Too dangerous. */
  260. ERROR_NO_INFERIOR;
  261. if (!signum_exp)
  262. error_no_arg ("signal number");
  263. signum = parse_and_eval_address (signum_exp);
  264. clear_proceed_status ();
  265. if (from_tty)
  266. printf ("Continuing with signal %d.\n", signum);
  267. proceed (stop_pc, signum, 0);
  268. }
  269. /* Execute a "stack dummy", a piece of code stored in the stack
  270. by the debugger to be executed in the inferior.
  271. To call: first, do PUSH_DUMMY_FRAME.
  272. Then push the contents of the dummy. It should end with a breakpoint insn.
  273. Then call here, passing address at which to start the dummy.
  274. We store the contents of r0 and r1 at the time of the completion
  275. of the stack dummy into the buffer at BUFFER.
  276. The dummy's frame is automatically popped whenever that break is hit.
  277. If that is the first time the program stops, run_stack_dummy
  278. returns to its caller with that frame already gone.
  279. Otherwise, the caller never gets returned to. */
  280. /* 4 => return instead of letting the stack dummy run. */
  281. static int stack_dummy_testing = 0;
  282. void
  283. run_stack_dummy (addr, buffer)
  284. CORE_ADDR addr;
  285. REGISTER_TYPE *buffer;
  286. {
  287. int saved_pc_changed = pc_changed;
  288. int saved_stop_signal = stop_signal;
  289. int saved_stop_pc = stop_pc;
  290. int saved_stop_frame = stop_frame;
  291. int saved_stop_breakpoint = stop_breakpoint;
  292. int saved_stop_step = stop_step;
  293. int saved_stop_stack_dummy = stop_stack_dummy;
  294. /* Now proceed, having reached the desired place. */
  295. clear_proceed_status ();
  296. if (stack_dummy_testing & 4)
  297. {
  298. POP_FRAME;
  299. return;
  300. }
  301. proceed (addr, 0, 0);
  302. if (!stop_stack_dummy)
  303. error ("Cannot continue previously requested operation.");
  304. stop_signal = saved_stop_signal;
  305. stop_pc = saved_stop_pc;
  306. stop_frame = saved_stop_frame;
  307. stop_breakpoint = saved_stop_breakpoint;
  308. stop_step = saved_stop_step;
  309. stop_stack_dummy = saved_stop_stack_dummy;
  310. pc_changed = saved_pc_changed;
  311. /* On return, the stack dummy has been popped already. */
  312. buffer[0] = stop_r0;
  313. buffer[1] = stop_r1;
  314. }
  315. /* "finish": Set a temporary breakpoint at the place
  316. the selected frame will return to, then continue. */
  317. static void
  318. finish_command (arg, from_tty)
  319. char *arg;
  320. int from_tty;
  321. {
  322. struct symtab_and_line sal;
  323. register FRAME frame;
  324. struct frame_info fi;
  325. register struct symbol *function;
  326. if (!have_inferior_p ())
  327. error ("The program is not being run.");
  328. if (arg)
  329. error ("The \"finish\" command does not take any arguments.");
  330. frame = get_prev_frame (selected_frame);
  331. if (frame == 0)
  332. error ("\"finish\" not meaningful in the outermost frame.");
  333. clear_proceed_status ();
  334. fi = get_frame_info (frame);
  335. sal = find_pc_line (fi.pc, 0);
  336. sal.pc = fi.pc;
  337. set_momentary_breakpoint (sal, frame);
  338. /* Find the function we will return from. */
  339. fi = get_frame_info (fi.next_frame);
  340. function = find_pc_function (fi.pc);
  341. if (from_tty)
  342. {
  343. printf ("Run till exit from ");
  344. print_selected_frame ();
  345. }
  346. proceed (-1, -1, 0);
  347. if (stop_breakpoint == -3 && function != 0)
  348. {
  349. struct type *value_type;
  350. REGISTER_TYPE retbuf[2];
  351. register value val;
  352. if (TYPE_CODE (SYMBOL_TYPE (function)) != TYPE_CODE_VOID)
  353. value_type = SYMBOL_TYPE (function);
  354. else
  355. return;
  356. retbuf[0] = stop_r0;
  357. retbuf[1] = stop_r1;
  358. val = value_being_returned (value_type, retbuf);
  359. printf ("Value returned is $%d = ", record_latest_value (val));
  360. value_print (val, stdout);
  361. putchar ('\n');
  362. }
  363. }
  364. static void
  365. program_info ()
  366. {
  367. if (inferior_pid == 0)
  368. {
  369. printf ("The program being debugged is not being run.\n");
  370. return;
  371. }
  372. printf ("Program being debugged is in process %d, stopped at 0x%x.\n",
  373. inferior_pid, stop_pc);
  374. if (stop_step)
  375. printf ("It stopped after being stepped.\n");
  376. else if (stop_breakpoint)
  377. printf ("It stopped at breakpoint %d.\n", stop_breakpoint);
  378. else if (stop_signal)
  379. printf ("It stopped with signal %d (%s).\n",
  380. stop_signal, sys_siglist[stop_signal]);
  381. printf ("\nType \"info stack\" or \"info reg\" for more information.\n");
  382. }
  383. static void
  384. environment_info (var)
  385. char *var;
  386. {
  387. if (var)
  388. {
  389. register char *val = get_in_environ (inferior_environ, var);
  390. if (val)
  391. printf ("%s = %s\n", var, val);
  392. else
  393. printf ("Environment variable \"%s\" not defined.\n", var);
  394. }
  395. else
  396. {
  397. register char **vector = environ_vector (inferior_environ);
  398. while (*vector)
  399. printf ("%s\n", *vector++);
  400. }
  401. }
  402. static void
  403. set_environment_command (arg)
  404. char *arg;
  405. {
  406. register char *p, *val, *var;
  407. if (arg == 0)
  408. error_no_arg ("environment variable and value");
  409. p = (char *) index (arg, '=');
  410. val = (char *) index (arg, ' ');
  411. if (p != 0 && val != 0)
  412. p = arg + min (p - arg, val - arg);
  413. else if (val != 0 && p == 0)
  414. p = val;
  415. if (p == 0)
  416. error ("Space or \"=\" must separate variable name and its value");
  417. if (p[1] == 0)
  418. error_no_arg ("value for the variable");
  419. if (p == arg)
  420. error_no_arg ("environment variable to set");
  421. val = p + 1;
  422. while (*val == ' ' || *val == '\t') val++;
  423. while (p != arg && (p[-1] == ' ' || p[-1] == '\t')) p--;
  424. var = savestring (arg, p - arg);
  425. set_in_environ (inferior_environ, var, val);
  426. free (var);
  427. }
  428. static void
  429. unset_environment_command (var)
  430. char *var;
  431. {
  432. if (var == 0)
  433. error_no_arg ("environment variable");
  434. unset_in_environ (inferior_environ, var);
  435. }
  436. /* Read an integer from debugged memory, given address and number of bytes. */
  437. read_memory_integer (memaddr, len)
  438. CORE_ADDR memaddr;
  439. int len;
  440. {
  441. char cbuf;
  442. short sbuf;
  443. int ibuf;
  444. long lbuf;
  445. if (len == sizeof (char))
  446. {
  447. read_memory (memaddr, &cbuf, len);
  448. return cbuf;
  449. }
  450. if (len == sizeof (short))
  451. {
  452. read_memory (memaddr, &sbuf, len);
  453. return sbuf;
  454. }
  455. if (len == sizeof (int))
  456. {
  457. read_memory (memaddr, &ibuf, len);
  458. return ibuf;
  459. }
  460. if (len == sizeof (lbuf))
  461. {
  462. read_memory (memaddr, &lbuf, len);
  463. return lbuf;
  464. }
  465. error ("Cannot handle integers of %d bytes.", len);
  466. }
  467. CORE_ADDR
  468. read_pc ()
  469. {
  470. return (CORE_ADDR) read_register (PC_REGNUM);
  471. }
  472. write_pc (value)
  473. CORE_ADDR value;
  474. {
  475. write_register (PC_REGNUM, (long) value);
  476. }
  477. char *reg_names[] = REGISTER_NAMES;
  478. static void
  479. registers_info (addr_exp)
  480. char *addr_exp;
  481. {
  482. register int i;
  483. int regnum;
  484. if (addr_exp)
  485. {
  486. if (*addr_exp >= '0' && *addr_exp <= '9')
  487. regnum = atoi (addr_exp);
  488. else
  489. {
  490. register char *p = addr_exp;
  491. if (p[0] == '$')
  492. p++;
  493. for (regnum = 0; regnum < NUM_REGS; regnum++)
  494. if (!strcmp (p, reg_names[regnum]))
  495. break;
  496. if (regnum == NUM_REGS)
  497. error ("%s: invalid register name.", addr_exp);
  498. }
  499. }
  500. else
  501. printf ("Reg\tContents\n\n");
  502. for (i = 0; i < NUM_REGS; i++)
  503. {
  504. unsigned char raw_buffer[MAX_REGISTER_RAW_SIZE];
  505. unsigned char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE];
  506. REGISTER_TYPE val;
  507. if (addr_exp != 0 && i != regnum)
  508. continue;
  509. /* On machines with lots of registers, pause every 16 lines
  510. so user can read the output. */
  511. if (addr_exp == 0 && i > 0 && i % 16 == 0)
  512. {
  513. printf ("--Type Return to print more--");
  514. fflush (stdout);
  515. read_line ();
  516. }
  517. /* Get the data in raw format, then convert also to virtual format. */
  518. read_relative_register_raw_bytes (i, raw_buffer);
  519. REGISTER_CONVERT_TO_VIRTUAL (i, raw_buffer, virtual_buffer);
  520. printf ("%s\t", reg_names[i]);
  521. /* If virtual format is floating, print it that way. */
  522. if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT
  523. && ! INVALID_FLOAT (virtual_buffer))
  524. val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, stdout);
  525. /* Else if virtual format is too long for printf,
  526. print in hex a byte at a time. */
  527. else if (REGISTER_VIRTUAL_SIZE (i) > sizeof (long))
  528. {
  529. register int j;
  530. printf ("0x");
  531. for (j = 0; j < REGISTER_VIRTUAL_SIZE (i); j++)
  532. printf ("%02x", virtual_buffer[j]);
  533. }
  534. /* Else print as integer in hex and in decimal. */
  535. else
  536. {
  537. long val;
  538. bcopy (virtual_buffer, &val, sizeof (long));
  539. if (val == 0)
  540. printf ("0");
  541. else
  542. printf ("0x%08x %d", val, val);
  543. }
  544. /* If register has different raw and virtual formats,
  545. print the raw format in hex now. */
  546. if (REGISTER_CONVERTIBLE (i))
  547. {
  548. register int j;
  549. printf (" (raw 0x");
  550. for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
  551. printf ("%02x", raw_buffer[j]);
  552. printf (")");
  553. }
  554. printf ("\n");
  555. }
  556. printf ("Contents are relative to selected stack frame.\n");
  557. }
  558. static
  559. initialize ()
  560. {
  561. add_com ("set-args", class_run, set_args_command,
  562. "Specify arguments to give program being debugged when it is started.\n\
  563. Follow this command with any number of args, to be passed to the program.");
  564. add_info ("environment", environment_info,
  565. "The environment to give the program, or one variable's value.\n\
  566. With an argument VAR, prints the value of environment variable VAR to\n\
  567. give the program being debugged. With no arguments, prints the entire\n\
  568. environment to be given to the program.");
  569. add_com ("unset-environment", class_run, unset_environment_command,
  570. "Cancel environment variable VAR for the program.\n\
  571. This does not affect the program until the next \"run\" command.");
  572. add_com ("set-environment", class_run, set_environment_command,
  573. "Set environment variable value to give the program.\n\
  574. Arguments are VAR VALUE where VAR is variable name and VALUE is value.\n\
  575. VALUES of environment variables are uninterpreted strings.\n\
  576. This does not affect the program until the next \"run\" command.");
  577. add_com ("signal", class_run, signal_command,
  578. "Continue program giving it signal number SIGNUMBER.");
  579. add_com ("stepi", class_run, stepi_command,
  580. "Step one instruction exactly.\n\
  581. Argument N means do this N times (or till program stops for another reason).");
  582. add_com_alias ("si", "stepi", class_alias, 0);
  583. add_com ("nexti", class_run, nexti_command,
  584. "Step one instruction, but proceed through subroutine calls.\n\
  585. Argument N means do this N times (or till program stops for another reason).");
  586. add_com_alias ("ni", "nexti", class_alias, 0);
  587. add_com ("finish", class_run, finish_command,
  588. "Execute until selected stack frame returns.\n\
  589. Upon return, the value returned is printed and put in the value history.");
  590. add_com ("next", class_run, next_command,
  591. "Step program, proceeding through subroutine calls.\n\
  592. Like the \"step\" command as long as subroutine calls do not happen;\n\
  593. when they do, the call is treated as one instruction.\n\
  594. Argument N means do this N times (or till program stops for another reason).");
  595. add_com_alias ("n", "next", class_run, 1);
  596. add_com ("step", class_run, step_command,
  597. "Step program until it reaches a different source line.\n\
  598. Argument N means do this N times (or till program stops for another reason).");
  599. add_com_alias ("s", "step", class_run, 1);
  600. add_com ("jump", class_run, jump_command,
  601. "Continue program being debugged at specified line or address.\n\
  602. Give as argument either LINENUM or *ADDR, where ADDR is an expression\n\
  603. for an address to start at.");
  604. add_com ("cont", class_run, cont_command,
  605. "Continue program being debugged, after signal or breakpoint.\n\
  606. If proceeding from breakpoint, a number N may be used as an argument:\n\
  607. then the same breakpoint won't break until the Nth time it is reached.");
  608. add_com_alias ("c", "cont", class_run, 1);
  609. add_com ("run", class_run, run_command,
  610. "Start debugged program. You may specify arguments to give it.\n\
  611. Args may include \"*\", or \"[...]\"; they are expanded using \"sh\".\n\
  612. Input and output redirection with \">\", \"<\", or \">>\" are also allowed.\n\n\
  613. With no arguments, uses arguments last specified (with \"run\" or \"set-args\".\n\
  614. To cancel previous arguments and run with no arguments,\n\
  615. use \"set-args\" without arguments.");
  616. add_com_alias ("r", "run", class_run, 1);
  617. add_info ("registers", registers_info,
  618. "List of registers and their contents, for selected stack frame.\n\
  619. Register name as argument means describe only that register.");
  620. add_info ("program", program_info,
  621. "Execution status of the program.");
  622. inferior_args = savestring (" ", 1); /* By default, no args. */
  623. inferior_environ = make_environ ();
  624. init_environ (inferior_environ);
  625. }
  626. END_FILE