* ch-typeprint.c (chill_type_print_base): Make TYPE_CODE_RANGE
[deliverable/binutils-gdb.git] / gdb / infcmd.c
CommitLineData
ee0613d1
JG
1/* Memory-access and commands for "inferior" (child) process, for GDB.
2 Copyright 1986, 1987, 1988, 1989, 1991, 1992 Free Software Foundation, Inc.
bd5635a1
RP
3
4This file is part of GDB.
5
ee0613d1 6This program is free software; you can redistribute it and/or modify
bd5635a1 7it under the terms of the GNU General Public License as published by
ee0613d1
JG
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
bd5635a1 10
ee0613d1 11This program is distributed in the hope that it will be useful,
bd5635a1
RP
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
ee0613d1
JG
17along with this program; if not, write to the Free Software
18Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
bd5635a1 19
1304f099 20#include "defs.h"
bd5635a1
RP
21#include <signal.h>
22#include <sys/param.h>
23#include <string.h>
bd5635a1 24#include "symtab.h"
1304f099 25#include "gdbtypes.h"
bd5635a1
RP
26#include "frame.h"
27#include "inferior.h"
28#include "environ.h"
29#include "value.h"
30#include "gdbcmd.h"
31#include "gdbcore.h"
32#include "target.h"
f6c4bf1a 33#include "language.h"
bd5635a1 34
1304f099
JG
35static void
36continue_command PARAMS ((char *, int));
37
38static void
39until_next_command PARAMS ((int));
40
41static void
42until_command PARAMS ((char *, int));
43
44static void
45path_info PARAMS ((char *, int));
46
47static void
48path_command PARAMS ((char *, int));
49
50static void
51unset_command PARAMS ((char *, int));
52
53static void
54float_info PARAMS ((char *, int));
55
56static void
57detach_command PARAMS ((char *, int));
58
59static void
60nofp_registers_info PARAMS ((char *, int));
61
62static void
63all_registers_info PARAMS ((char *, int));
64
65static void
66registers_info PARAMS ((char *, int));
67
68static void
69do_registers_info PARAMS ((int, int));
70
71static void
72unset_environment_command PARAMS ((char *, int));
73
74static void
75set_environment_command PARAMS ((char *, int));
76
77static void
78environment_info PARAMS ((char *, int));
79
80static void
81program_info PARAMS ((char *, int));
82
83static void
84finish_command PARAMS ((char *, int));
85
86static void
87signal_command PARAMS ((char *, int));
88
89static void
90jump_command PARAMS ((char *, int));
91
92static void
93step_1 PARAMS ((int, int, char *));
94
95static void
96nexti_command PARAMS ((char *, int));
bd5635a1 97
1304f099
JG
98static void
99stepi_command PARAMS ((char *, int));
100
101static void
102next_command PARAMS ((char *, int));
103
104static void
105step_command PARAMS ((char *, int));
106
107static void
108run_command PARAMS ((char *, int));
bd5635a1
RP
109
110#define ERROR_NO_INFERIOR \
111 if (!target_has_execution) error ("The program is not being run.");
112
113/* String containing arguments to give to the program, separated by spaces.
114 Empty string (pointer to '\0') means no args. */
115
116static char *inferior_args;
117
118/* File name for default use for standard in/out in the inferior. */
119
120char *inferior_io_terminal;
121
122/* Pid of our debugged inferior, or 0 if no inferior now.
123 Since various parts of infrun.c test this to see whether there is a program
124 being debugged it should be nonzero (currently 3 is used) for remote
125 debugging. */
126
127int inferior_pid;
128
129/* Last signal that the inferior received (why it stopped). */
130
67ac9759 131enum target_signal stop_signal;
bd5635a1
RP
132
133/* Address at which inferior stopped. */
134
135CORE_ADDR stop_pc;
136
137/* Stack frame when program stopped. */
138
139FRAME_ADDR stop_frame_address;
140
141/* Chain containing status of breakpoint(s) that we have stopped at. */
142
143bpstat stop_bpstat;
144
145/* Flag indicating that a command has proceeded the inferior past the
146 current breakpoint. */
147
148int breakpoint_proceeded;
149
150/* Nonzero if stopped due to a step command. */
151
152int stop_step;
153
154/* Nonzero if stopped due to completion of a stack dummy routine. */
155
156int stop_stack_dummy;
157
158/* Nonzero if stopped due to a random (unexpected) signal in inferior
159 process. */
160
161int stopped_by_random_signal;
162
163/* Range to single step within.
164 If this is nonzero, respond to a single-step signal
165 by continuing to step if the pc is in this range. */
166
167CORE_ADDR step_range_start; /* Inclusive */
168CORE_ADDR step_range_end; /* Exclusive */
169
170/* Stack frame address as of when stepping command was issued.
171 This is how we know when we step into a subroutine call,
172 and how to set the frame for the breakpoint used to step out. */
173
174FRAME_ADDR step_frame_address;
175
176/* 1 means step over all subroutine calls.
b5a3d2aa 177 0 means don't step over calls (used by stepi).
bd5635a1
RP
178 -1 means step over calls to undebuggable functions. */
179
180int step_over_calls;
181
182/* If stepping, nonzero means step count is > 1
183 so don't print frame next time inferior stops
184 if it stops due to stepping. */
185
186int step_multi;
187
188/* Environment to use for running inferior,
189 in format described in environ.h. */
190
191struct environ *inferior_environ;
192
bd5635a1 193\f
e1ce8aa5 194/* ARGSUSED */
bd5635a1
RP
195void
196tty_command (file, from_tty)
197 char *file;
198 int from_tty;
199{
200 if (file == 0)
201 error_no_arg ("terminal name for running target process");
202
203 inferior_io_terminal = savestring (file, strlen (file));
204}
205
206static void
207run_command (args, from_tty)
208 char *args;
209 int from_tty;
210{
211 char *exec_file;
212
213 dont_repeat ();
214
02ff0cd3 215 /* Shouldn't this be target_has_execution? FIXME. */
bd5635a1
RP
216 if (inferior_pid)
217 {
218 if (
219 !query ("The program being debugged has been started already.\n\
220Start it from the beginning? "))
221 error ("Program not restarted.");
ee0613d1 222 target_kill ();
bd5635a1
RP
223 }
224
9f577285
SS
225 clear_breakpoint_hit_counts ();
226
bd5635a1
RP
227 exec_file = (char *) get_exec_file (0);
228
1304f099 229 /* The exec file is re-read every time we do a generic_mourn_inferior, so
bd5635a1
RP
230 we just have to worry about the symbol file. */
231 reread_symbols ();
232
f6c4bf1a
JK
233 /* We keep symbols from add-symbol-file, on the grounds that the
234 user might want to add some symbols before running the program
235 (right?). But sometimes (dynamic loading where the user manually
236 introduces the new symbols with add-symbol-file), the code which
237 the symbols describe does not persist between runs. Currently
238 the user has to manually nuke all symbols between runs if they
239 want them to go away (PR 2207). This is probably reasonable. */
240
bd5635a1
RP
241 if (args)
242 {
243 char *cmd;
ee0613d1 244 cmd = concat ("set args ", args, NULL);
bd5635a1
RP
245 make_cleanup (free, cmd);
246 execute_command (cmd, from_tty);
247 }
248
249 if (from_tty)
250 {
b5a3d2aa
SG
251 puts_filtered("Starting program: ");
252 if (exec_file)
253 puts_filtered(exec_file);
254 puts_filtered(" ");
255 puts_filtered(inferior_args);
256 puts_filtered("\n");
199b2450 257 gdb_flush (gdb_stdout);
bd5635a1
RP
258 }
259
260 target_create_inferior (exec_file, inferior_args,
261 environ_vector (inferior_environ));
262}
263\f
1304f099 264static void
bd5635a1
RP
265continue_command (proc_count_exp, from_tty)
266 char *proc_count_exp;
267 int from_tty;
268{
269 ERROR_NO_INFERIOR;
270
271 /* If have argument, set proceed count of breakpoint we stopped at. */
272
273 if (proc_count_exp != NULL)
274 {
275 bpstat bs = stop_bpstat;
276 int num = bpstat_num (&bs);
277 if (num == 0 && from_tty)
278 {
279 printf_filtered
280 ("Not stopped at any breakpoint; argument ignored.\n");
281 }
282 while (num != 0)
283 {
284 set_ignore_count (num,
285 parse_and_eval_address (proc_count_exp) - 1,
286 from_tty);
287 /* set_ignore_count prints a message ending with a period.
288 So print two spaces before "Continuing.". */
289 if (from_tty)
1304f099 290 printf_filtered (" ");
bd5635a1
RP
291 num = bpstat_num (&bs);
292 }
293 }
294
295 if (from_tty)
1304f099 296 printf_filtered ("Continuing.\n");
bd5635a1
RP
297
298 clear_proceed_status ();
299
c6e0f918 300 proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
bd5635a1
RP
301}
302\f
303/* Step until outside of current statement. */
bd5635a1 304
e1ce8aa5 305/* ARGSUSED */
bd5635a1
RP
306static void
307step_command (count_string, from_tty)
1304f099 308 char *count_string;
bd5635a1
RP
309 int from_tty;
310{
311 step_1 (0, 0, count_string);
312}
313
314/* Likewise, but skip over subroutine calls as if single instructions. */
315
e1ce8aa5 316/* ARGSUSED */
bd5635a1
RP
317static void
318next_command (count_string, from_tty)
1304f099 319 char *count_string;
bd5635a1
RP
320 int from_tty;
321{
322 step_1 (1, 0, count_string);
323}
324
325/* Likewise, but step only one instruction. */
326
e1ce8aa5 327/* ARGSUSED */
bd5635a1
RP
328static void
329stepi_command (count_string, from_tty)
1304f099 330 char *count_string;
bd5635a1
RP
331 int from_tty;
332{
333 step_1 (0, 1, count_string);
334}
335
e1ce8aa5 336/* ARGSUSED */
bd5635a1
RP
337static void
338nexti_command (count_string, from_tty)
1304f099 339 char *count_string;
bd5635a1
RP
340 int from_tty;
341{
342 step_1 (1, 1, count_string);
343}
344
345static void
346step_1 (skip_subroutines, single_inst, count_string)
347 int skip_subroutines;
348 int single_inst;
349 char *count_string;
350{
351 register int count = 1;
352 FRAME fr;
1304f099 353 struct cleanup *cleanups = 0;
bd5635a1
RP
354
355 ERROR_NO_INFERIOR;
356 count = count_string ? parse_and_eval_address (count_string) : 1;
357
1304f099
JG
358 if (!single_inst || skip_subroutines) /* leave si command alone */
359 {
360 enable_longjmp_breakpoint();
361 cleanups = make_cleanup(disable_longjmp_breakpoint, 0);
362 }
363
bd5635a1
RP
364 for (; count > 0; count--)
365 {
366 clear_proceed_status ();
367
bd5635a1
RP
368 fr = get_current_frame ();
369 if (!fr) /* Avoid coredump here. Why tho? */
370 error ("No current frame");
371 step_frame_address = FRAME_FP (fr);
372
373 if (! single_inst)
374 {
375 find_pc_line_pc_range (stop_pc, &step_range_start, &step_range_end);
376 if (step_range_end == 0)
377 {
860a1754
JK
378 char *name;
379 if (find_pc_partial_function (stop_pc, &name, &step_range_start,
380 &step_range_end) == 0)
381 error ("Cannot find bounds of current function");
bd5635a1 382
bd5635a1 383 target_terminal_ours ();
860a1754
JK
384 printf_filtered ("\
385Single stepping until exit from function %s, \n\
386which has no line number information.\n", name);
199b2450 387 gdb_flush (gdb_stdout);
bd5635a1
RP
388 }
389 }
390 else
391 {
fe675038 392 /* Say we are stepping, but stop after one insn whatever it does. */
bd5635a1
RP
393 step_range_start = step_range_end = 1;
394 if (!skip_subroutines)
fe675038
JK
395 /* It is stepi.
396 Don't step over function calls, not even to functions lacking
397 line numbers. */
bd5635a1
RP
398 step_over_calls = 0;
399 }
400
401 if (skip_subroutines)
402 step_over_calls = 1;
403
404 step_multi = (count > 1);
c6e0f918 405 proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
bd5635a1
RP
406 if (! stop_step)
407 break;
5573d7d4
JK
408
409 /* FIXME: On nexti, this may have already been done (when we hit the
410 step resume break, I think). Probably this should be moved to
411 wait_for_inferior (near the top). */
bd5635a1 412#if defined (SHIFT_INST_REGS)
07a5991a 413 SHIFT_INST_REGS();
bd5635a1
RP
414#endif
415 }
1304f099
JG
416
417 if (!single_inst || skip_subroutines)
418 do_cleanups(cleanups);
bd5635a1
RP
419}
420\f
421/* Continue program at specified address. */
422
423static void
424jump_command (arg, from_tty)
425 char *arg;
426 int from_tty;
427{
428 register CORE_ADDR addr;
429 struct symtabs_and_lines sals;
430 struct symtab_and_line sal;
b4fde6fa
FF
431 struct symbol *fn;
432 struct symbol *sfn;
bd5635a1
RP
433
434 ERROR_NO_INFERIOR;
435
436 if (!arg)
437 error_no_arg ("starting address");
438
439 sals = decode_line_spec_1 (arg, 1);
440 if (sals.nelts != 1)
441 {
442 error ("Unreasonable jump request");
443 }
444
445 sal = sals.sals[0];
1304f099 446 free ((PTR)sals.sals);
bd5635a1
RP
447
448 if (sal.symtab == 0 && sal.pc == 0)
449 error ("No source file has been specified.");
450
ee0613d1 451 resolve_sal_pc (&sal); /* May error out */
bd5635a1 452
b4fde6fa
FF
453 /* See if we are trying to jump to another function. */
454 fn = get_frame_function (get_current_frame ());
455 sfn = find_pc_function (sal.pc);
456 if (fn != NULL && sfn != fn)
457 {
2e4964ad
FF
458 if (!query ("Line %d is not in `%s'. Jump anyway? ", sal.line,
459 SYMBOL_SOURCE_NAME (fn)))
b4fde6fa
FF
460 {
461 error ("Not confirmed.");
462 /* NOTREACHED */
463 }
b4fde6fa 464 }
bd5635a1 465
5573d7d4 466 addr = sal.pc;
bd5635a1
RP
467
468 if (from_tty)
9f577285
SS
469 {
470 printf_filtered ("Continuing at ");
471 print_address_numeric (addr, 1, gdb_stdout);
472 printf_filtered (".\n");
473 }
bd5635a1
RP
474
475 clear_proceed_status ();
67ac9759 476 proceed (addr, TARGET_SIGNAL_0, 0);
bd5635a1
RP
477}
478
479/* Continue program giving it specified signal. */
480
481static void
482signal_command (signum_exp, from_tty)
483 char *signum_exp;
484 int from_tty;
485{
67ac9759 486 enum target_signal oursig;
bd5635a1
RP
487
488 dont_repeat (); /* Too dangerous. */
489 ERROR_NO_INFERIOR;
490
491 if (!signum_exp)
492 error_no_arg ("signal number");
493
de6a2704
JK
494 /* It would be even slicker to make signal names be valid expressions,
495 (the type could be "enum $signal" or some such), then the user could
496 assign them to convenience variables. */
67ac9759 497 oursig = target_signal_from_name (signum_exp);
de6a2704 498
67ac9759
JK
499 if (oursig == TARGET_SIGNAL_UNKNOWN)
500 {
501 /* Not found as a name, try it as an expression. */
502 /* The numeric signal refers to our own internal signal numbering
503 from target.h, not to host/target signal number. This is a
504 feature; users really should be using symbolic names anyway,
505 and the common ones like SIGHUP, SIGINT, SIGALRM, etc. will
506 work right anyway. */
507 int signum = parse_and_eval_address (signum_exp);
c6e0f918 508 if (signum < 0
67ac9759 509 || signum >= (int)TARGET_SIGNAL_LAST
c6e0f918
JK
510 || signum == (int)TARGET_SIGNAL_UNKNOWN
511 || signum == (int)TARGET_SIGNAL_DEFAULT)
67ac9759
JK
512 error ("Invalid signal number %d.", signum);
513 oursig = signum;
514 }
bd5635a1
RP
515
516 if (from_tty)
de6a2704 517 {
67ac9759
JK
518 if (oursig == TARGET_SIGNAL_0)
519 printf_filtered ("Continuing with no signal.\n");
de6a2704 520 else
67ac9759
JK
521 printf_filtered ("Continuing with signal %s.\n",
522 target_signal_to_name (oursig));
de6a2704 523 }
bd5635a1
RP
524
525 clear_proceed_status ();
67ac9759 526 proceed (stop_pc, oursig, 0);
bd5635a1
RP
527}
528
84d59861
JK
529/* Call breakpoint_auto_delete on the current contents of the bpstat
530 pointed to by arg (which is really a bpstat *). */
531void
532breakpoint_auto_delete_contents (arg)
533 PTR arg;
534{
535 breakpoint_auto_delete (*(bpstat *)arg);
536}
537
bd5635a1
RP
538/* Execute a "stack dummy", a piece of code stored in the stack
539 by the debugger to be executed in the inferior.
540
541 To call: first, do PUSH_DUMMY_FRAME.
542 Then push the contents of the dummy. It should end with a breakpoint insn.
543 Then call here, passing address at which to start the dummy.
544
545 The contents of all registers are saved before the dummy frame is popped
546 and copied into the buffer BUFFER.
547
548 The dummy's frame is automatically popped whenever that break is hit.
549 If that is the first time the program stops, run_stack_dummy
860a1754
JK
550 returns to its caller with that frame already gone and returns 0.
551 Otherwise, run_stack-dummy returns 1 (the frame will eventually be popped
552 when we do hit that breakpoint). */
bd5635a1 553
ee0613d1 554/* DEBUG HOOK: 4 => return instead of letting the stack dummy run. */
bd5635a1
RP
555
556static int stack_dummy_testing = 0;
557
860a1754
JK
558int
559run_stack_dummy (addr, buffer)
bd5635a1
RP
560 CORE_ADDR addr;
561 char buffer[REGISTER_BYTES];
562{
84d59861
JK
563 struct cleanup *old_cleanups = make_cleanup (null_cleanup, 0);
564
bd5635a1
RP
565 /* Now proceed, having reached the desired place. */
566 clear_proceed_status ();
567 if (stack_dummy_testing & 4)
568 {
569 POP_FRAME;
37c99ddb 570 return(0);
bd5635a1 571 }
84d59861
JK
572#ifdef CALL_DUMMY_BREAKPOINT_OFFSET
573 {
574 struct breakpoint *bpt;
575 struct symtab_and_line sal;
576
f6c4bf1a 577#if CALL_DUMMY_LOCATION != AT_ENTRY_POINT
84d59861 578 sal.pc = addr - CALL_DUMMY_START_OFFSET + CALL_DUMMY_BREAKPOINT_OFFSET;
f6c4bf1a 579#else
9f577285 580 sal.pc = CALL_DUMMY_ADDRESS ();
f6c4bf1a 581#endif
84d59861
JK
582 sal.symtab = NULL;
583 sal.line = 0;
584
f6c4bf1a
JK
585 /* Set up a FRAME for the dummy frame so we can pass it to
586 set_momentary_breakpoint. We need to give the breakpoint a
587 frame in case there is only one copy of the dummy (e.g.
588 CALL_DUMMY_LOCATION == AFTER_TEXT_END). */
589 flush_cached_frames ();
590 set_current_frame (create_new_frame (read_fp (), sal.pc));
591
84d59861
JK
592 /* If defined, CALL_DUMMY_BREAKPOINT_OFFSET is where we need to put
593 a breakpoint instruction. If not, the call dummy already has the
594 breakpoint instruction in it.
595
596 addr is the address of the call dummy plus the CALL_DUMMY_START_OFFSET,
597 so we need to subtract the CALL_DUMMY_START_OFFSET. */
598 bpt = set_momentary_breakpoint (sal,
f6c4bf1a 599 get_current_frame (),
84d59861
JK
600 bp_call_dummy);
601 bpt->disposition = delete;
602
603 /* If all error()s out of proceed ended up calling normal_stop (and
604 perhaps they should; it already does in the special case of error
605 out of resume()), then we wouldn't need this. */
606 make_cleanup (breakpoint_auto_delete_contents, &stop_bpstat);
607 }
608#endif /* CALL_DUMMY_BREAKPOINT_OFFSET. */
609
bd5635a1 610 proceed_to_finish = 1; /* We want stop_registers, please... */
67ac9759 611 proceed (addr, TARGET_SIGNAL_0, 0);
bd5635a1 612
84d59861
JK
613 discard_cleanups (old_cleanups);
614
bd5635a1 615 if (!stop_stack_dummy)
860a1754 616 return 1;
bd5635a1
RP
617
618 /* On return, the stack dummy has been popped already. */
619
4ed3a9ea 620 memcpy (buffer, stop_registers, sizeof stop_registers);
860a1754 621 return 0;
bd5635a1
RP
622}
623\f
624/* Proceed until we reach a different source line with pc greater than
625 our current one or exit the function. We skip calls in both cases.
626
627 Note that eventually this command should probably be changed so
628 that only source lines are printed out when we hit the breakpoint
c6e0f918
JK
629 we set. This may involve changes to wait_for_inferior and the
630 proceed status code. */
bd5635a1 631
e1ce8aa5 632/* ARGSUSED */
1304f099 633static void
bd5635a1
RP
634until_next_command (from_tty)
635 int from_tty;
636{
637 FRAME frame;
638 CORE_ADDR pc;
639 struct symbol *func;
640 struct symtab_and_line sal;
641
642 clear_proceed_status ();
643
644 frame = get_current_frame ();
645
646 /* Step until either exited from this function or greater
647 than the current line (if in symbolic section) or pc (if
648 not). */
649
650 pc = read_pc ();
651 func = find_pc_function (pc);
652
653 if (!func)
654 {
1304f099 655 struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (pc);
bd5635a1 656
1304f099 657 if (msymbol == NULL)
bd5635a1
RP
658 error ("Execution is not within a known function.");
659
2e4964ad 660 step_range_start = SYMBOL_VALUE_ADDRESS (msymbol);
bd5635a1
RP
661 step_range_end = pc;
662 }
663 else
664 {
665 sal = find_pc_line (pc, 0);
666
667 step_range_start = BLOCK_START (SYMBOL_BLOCK_VALUE (func));
668 step_range_end = sal.end;
669 }
670
671 step_over_calls = 1;
672 step_frame_address = FRAME_FP (frame);
673
674 step_multi = 0; /* Only one call to proceed */
675
c6e0f918 676 proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
bd5635a1
RP
677}
678
1304f099 679static void
bd5635a1
RP
680until_command (arg, from_tty)
681 char *arg;
682 int from_tty;
683{
684 if (!target_has_execution)
685 error ("The program is not running.");
686 if (arg)
687 until_break_command (arg, from_tty);
688 else
689 until_next_command (from_tty);
690}
691\f
692/* "finish": Set a temporary breakpoint at the place
693 the selected frame will return to, then continue. */
694
695static void
696finish_command (arg, from_tty)
697 char *arg;
698 int from_tty;
699{
700 struct symtab_and_line sal;
701 register FRAME frame;
702 struct frame_info *fi;
703 register struct symbol *function;
1304f099
JG
704 struct breakpoint *breakpoint;
705 struct cleanup *old_chain;
bd5635a1
RP
706
707 if (arg)
708 error ("The \"finish\" command does not take any arguments.");
709 if (!target_has_execution)
710 error ("The program is not running.");
777bef06
JK
711 if (selected_frame == NULL)
712 error ("No selected frame.");
bd5635a1
RP
713
714 frame = get_prev_frame (selected_frame);
715 if (frame == 0)
716 error ("\"finish\" not meaningful in the outermost frame.");
717
718 clear_proceed_status ();
719
720 fi = get_frame_info (frame);
721 sal = find_pc_line (fi->pc, 0);
722 sal.pc = fi->pc;
1304f099
JG
723
724 breakpoint = set_momentary_breakpoint (sal, frame, bp_finish);
725
726 old_chain = make_cleanup(delete_breakpoint, breakpoint);
bd5635a1
RP
727
728 /* Find the function we will return from. */
729
730 fi = get_frame_info (selected_frame);
731 function = find_pc_function (fi->pc);
732
ee0613d1
JG
733 /* Print info on the selected frame, including level number
734 but not source. */
bd5635a1
RP
735 if (from_tty)
736 {
ee0613d1
JG
737 printf_filtered ("Run till exit from ");
738 print_stack_frame (selected_frame, selected_frame_level, 0);
bd5635a1
RP
739 }
740
741 proceed_to_finish = 1; /* We want stop_registers, please... */
c6e0f918 742 proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
bd5635a1 743
1304f099
JG
744 /* Did we stop at our breakpoint? */
745 if (bpstat_find_breakpoint(stop_bpstat, breakpoint) != NULL
746 && function != 0)
bd5635a1
RP
747 {
748 struct type *value_type;
9f577285 749 register value_ptr val;
bd5635a1
RP
750 CORE_ADDR funcaddr;
751
752 value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function));
753 if (!value_type)
754 fatal ("internal: finish_command: function has no target type");
755
756 if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
757 return;
758
759 funcaddr = BLOCK_START (SYMBOL_BLOCK_VALUE (function));
760
761 val = value_being_returned (value_type, stop_registers,
860a1754 762 using_struct_return (value_of_variable (function, NULL),
bd5635a1
RP
763 funcaddr,
764 value_type,
765 BLOCK_GCC_COMPILED (SYMBOL_BLOCK_VALUE (function))));
766
ee0613d1 767 printf_filtered ("Value returned is $%d = ", record_latest_value (val));
199b2450 768 value_print (val, gdb_stdout, 0, Val_no_prettyprint);
ee0613d1 769 printf_filtered ("\n");
bd5635a1 770 }
1304f099 771 do_cleanups(old_chain);
bd5635a1
RP
772}
773\f
e1ce8aa5 774/* ARGSUSED */
bd5635a1
RP
775static void
776program_info (args, from_tty)
777 char *args;
778 int from_tty;
779{
780 bpstat bs = stop_bpstat;
781 int num = bpstat_num (&bs);
782
783 if (!target_has_execution)
784 {
1304f099 785 printf_filtered ("The program being debugged is not being run.\n");
bd5635a1
RP
786 return;
787 }
788
789 target_files_info ();
5573d7d4
JK
790 printf_filtered ("Program stopped at %s.\n",
791 local_hex_string((unsigned long) stop_pc));
bd5635a1 792 if (stop_step)
1304f099 793 printf_filtered ("It stopped after being stepped.\n");
bd5635a1
RP
794 else if (num != 0)
795 {
796 /* There may be several breakpoints in the same place, so this
797 isn't as strange as it seems. */
798 while (num != 0)
799 {
800 if (num < 0)
1304f099 801 printf_filtered ("It stopped at a breakpoint that has since been deleted.\n");
bd5635a1 802 else
1304f099 803 printf_filtered ("It stopped at breakpoint %d.\n", num);
bd5635a1
RP
804 num = bpstat_num (&bs);
805 }
806 }
67ac9759 807 else if (stop_signal != TARGET_SIGNAL_0)
de6a2704 808 {
67ac9759
JK
809 printf_filtered ("It stopped with signal %s, %s.\n",
810 target_signal_to_name (stop_signal),
811 target_signal_to_string (stop_signal));
812 }
bd5635a1
RP
813
814 if (!from_tty)
1304f099 815 printf_filtered ("Type \"info stack\" or \"info registers\" for more information.\n");
bd5635a1
RP
816}
817\f
818static void
1304f099 819environment_info (var, from_tty)
bd5635a1 820 char *var;
1304f099 821 int from_tty;
bd5635a1
RP
822{
823 if (var)
824 {
825 register char *val = get_in_environ (inferior_environ, var);
826 if (val)
631f7a9f
JG
827 {
828 puts_filtered (var);
829 puts_filtered (" = ");
830 puts_filtered (val);
831 puts_filtered ("\n");
832 }
bd5635a1 833 else
631f7a9f
JG
834 {
835 puts_filtered ("Environment variable \"");
836 puts_filtered (var);
837 puts_filtered ("\" not defined.\n");
838 }
bd5635a1
RP
839 }
840 else
841 {
842 register char **vector = environ_vector (inferior_environ);
843 while (*vector)
631f7a9f
JG
844 {
845 puts_filtered (*vector++);
846 puts_filtered ("\n");
847 }
bd5635a1
RP
848 }
849}
850
851static void
1304f099 852set_environment_command (arg, from_tty)
bd5635a1 853 char *arg;
1304f099 854 int from_tty;
bd5635a1
RP
855{
856 register char *p, *val, *var;
857 int nullset = 0;
858
859 if (arg == 0)
860 error_no_arg ("environment variable and value");
861
862 /* Find seperation between variable name and value */
863 p = (char *) strchr (arg, '=');
864 val = (char *) strchr (arg, ' ');
865
866 if (p != 0 && val != 0)
867 {
868 /* We have both a space and an equals. If the space is before the
631f7a9f
JG
869 equals, walk forward over the spaces til we see a nonspace
870 (possibly the equals). */
bd5635a1
RP
871 if (p > val)
872 while (*val == ' ')
873 val++;
874
631f7a9f
JG
875 /* Now if the = is after the char following the spaces,
876 take the char following the spaces. */
877 if (p > val)
b5a3d2aa 878 p = val - 1;
bd5635a1
RP
879 }
880 else if (val != 0 && p == 0)
881 p = val;
882
883 if (p == arg)
884 error_no_arg ("environment variable to set");
885
886 if (p == 0 || p[1] == 0)
887 {
888 nullset = 1;
889 if (p == 0)
890 p = arg + strlen (arg); /* So that savestring below will work */
891 }
892 else
893 {
894 /* Not setting variable value to null */
895 val = p + 1;
896 while (*val == ' ' || *val == '\t')
897 val++;
898 }
899
900 while (p != arg && (p[-1] == ' ' || p[-1] == '\t')) p--;
901
902 var = savestring (arg, p - arg);
903 if (nullset)
904 {
1304f099 905 printf_filtered ("Setting environment variable \"%s\" to null value.\n", var);
bd5635a1
RP
906 set_in_environ (inferior_environ, var, "");
907 }
908 else
909 set_in_environ (inferior_environ, var, val);
910 free (var);
911}
912
913static void
914unset_environment_command (var, from_tty)
915 char *var;
916 int from_tty;
917{
918 if (var == 0)
919 {
920 /* If there is no argument, delete all environment variables.
921 Ask for confirmation if reading from the terminal. */
922 if (!from_tty || query ("Delete all environment variables? "))
923 {
924 free_environ (inferior_environ);
925 inferior_environ = make_environ ();
926 }
927 }
928 else
929 unset_in_environ (inferior_environ, var);
930}
931
932/* Handle the execution path (PATH variable) */
933
a8a69e63 934static const char path_var_name[] = "PATH";
bd5635a1 935
e1ce8aa5 936/* ARGSUSED */
1304f099 937static void
bd5635a1
RP
938path_info (args, from_tty)
939 char *args;
940 int from_tty;
941{
b5a3d2aa
SG
942 puts_filtered ("Executable and object file path: ");
943 puts_filtered (get_in_environ (inferior_environ, path_var_name));
944 puts_filtered ("\n");
bd5635a1
RP
945}
946
947/* Add zero or more directories to the front of the execution path. */
948
1304f099 949static void
bd5635a1
RP
950path_command (dirname, from_tty)
951 char *dirname;
952 int from_tty;
953{
954 char *exec_path;
955
956 dont_repeat ();
957 exec_path = strsave (get_in_environ (inferior_environ, path_var_name));
e1ce8aa5 958 mod_path (dirname, &exec_path);
bd5635a1
RP
959 set_in_environ (inferior_environ, path_var_name, exec_path);
960 free (exec_path);
961 if (from_tty)
e1ce8aa5 962 path_info ((char *)NULL, from_tty);
bd5635a1
RP
963}
964\f
1304f099 965const char * const reg_names[] = REGISTER_NAMES;
bd5635a1
RP
966
967/* Print out the machine register regnum. If regnum is -1,
ee0613d1
JG
968 print all registers (fpregs == 1) or all non-float registers
969 (fpregs == 0).
970
bd5635a1
RP
971 For most machines, having all_registers_info() print the
972 register(s) one per line is good enough. If a different format
ee0613d1 973 is required, (eg, for MIPS or Pyramid 90x, which both have
bd5635a1 974 lots of regs), or there is an existing convention for showing
ee0613d1 975 all the registers, define the macro DO_REGISTERS_INFO(regnum, fp)
bd5635a1 976 to provide that format. */
ee0613d1 977
bd5635a1 978#if !defined (DO_REGISTERS_INFO)
ee0613d1
JG
979#define DO_REGISTERS_INFO(regnum, fp) do_registers_info(regnum, fp)
980static void
981do_registers_info (regnum, fpregs)
bd5635a1 982 int regnum;
ee0613d1 983 int fpregs;
bd5635a1
RP
984{
985 register int i;
986
bd5635a1
RP
987 for (i = 0; i < NUM_REGS; i++)
988 {
989 char raw_buffer[MAX_REGISTER_RAW_SIZE];
990 char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE];
991
ee0613d1
JG
992 /* Decide between printing all regs, nonfloat regs, or specific reg. */
993 if (regnum == -1) {
994 if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT && !fpregs)
995 continue;
996 } else {
997 if (i != regnum)
998 continue;
999 }
bd5635a1 1000
199b2450
TL
1001 fputs_filtered (reg_names[i], gdb_stdout);
1002 print_spaces_filtered (15 - strlen (reg_names[i]), gdb_stdout);
bd5635a1 1003
67ac9759 1004 /* Get the data in raw format. */
bd5635a1
RP
1005 if (read_relative_register_raw_bytes (i, raw_buffer))
1006 {
1007 printf_filtered ("Invalid register contents\n");
1008 continue;
1009 }
67ac9759
JK
1010
1011 /* Convert raw data to virtual format if necessary. */
1012#ifdef REGISTER_CONVERTIBLE
1013 if (REGISTER_CONVERTIBLE (i))
1014 {
1015 REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i),
1016 raw_buffer, virtual_buffer);
1017 }
1018 else
1019#endif
1020 memcpy (virtual_buffer, raw_buffer,
1021 REGISTER_VIRTUAL_SIZE (i));
bd5635a1
RP
1022
1023 /* If virtual format is floating, print it that way, and in raw hex. */
1024 if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT
1025 && ! INVALID_FLOAT (virtual_buffer, REGISTER_VIRTUAL_SIZE (i)))
1026 {
1027 register int j;
1028
1029 val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0,
199b2450 1030 gdb_stdout, 0, 1, 0, Val_pretty_default);
bd5635a1
RP
1031
1032 printf_filtered ("\t(raw 0x");
1033 for (j = 0; j < REGISTER_RAW_SIZE (i); j++)
1034 printf_filtered ("%02x", (unsigned char)raw_buffer[j]);
1035 printf_filtered (")");
1036 }
1037
1038/* FIXME! val_print probably can handle all of these cases now... */
1039
1040 /* Else if virtual format is too long for printf,
1041 print in hex a byte at a time. */
1042 else if (REGISTER_VIRTUAL_SIZE (i) > sizeof (long))
1043 {
1044 register int j;
1045 printf_filtered ("0x");
1046 for (j = 0; j < REGISTER_VIRTUAL_SIZE (i); j++)
1047 printf_filtered ("%02x", (unsigned char)virtual_buffer[j]);
1048 }
1049 /* Else print as integer in hex and in decimal. */
1050 else
1051 {
1052 val_print (REGISTER_VIRTUAL_TYPE (i), raw_buffer, 0,
199b2450 1053 gdb_stdout, 'x', 1, 0, Val_pretty_default);
bd5635a1
RP
1054 printf_filtered ("\t");
1055 val_print (REGISTER_VIRTUAL_TYPE (i), raw_buffer, 0,
199b2450 1056 gdb_stdout, 0, 1, 0, Val_pretty_default);
bd5635a1
RP
1057 }
1058
1059 /* The SPARC wants to print even-numbered float regs as doubles
1060 in addition to printing them as floats. */
1061#ifdef PRINT_REGISTER_HOOK
1062 PRINT_REGISTER_HOOK (i);
1063#endif
1064
1065 printf_filtered ("\n");
1066 }
1067}
1068#endif /* no DO_REGISTERS_INFO. */
1069
1070static void
ee0613d1 1071registers_info (addr_exp, fpregs)
bd5635a1 1072 char *addr_exp;
ee0613d1 1073 int fpregs;
bd5635a1
RP
1074{
1075 int regnum;
b5a3d2aa 1076 register char *end;
bd5635a1
RP
1077
1078 if (!target_has_registers)
1079 error ("The program has no registers now.");
1080
b5a3d2aa 1081 if (!addr_exp)
bd5635a1 1082 {
b5a3d2aa
SG
1083 DO_REGISTERS_INFO(-1, fpregs);
1084 return;
bd5635a1 1085 }
bd5635a1 1086
b5a3d2aa
SG
1087 do
1088 {
1089 if (addr_exp[0] == '$')
1090 addr_exp++;
1091 end = addr_exp;
1092 while (*end != '\0' && *end != ' ' && *end != '\t')
1093 ++end;
1094 for (regnum = 0; regnum < NUM_REGS; regnum++)
1095 if (!strncmp (addr_exp, reg_names[regnum], end - addr_exp)
1096 && strlen (reg_names[regnum]) == end - addr_exp)
1097 goto found;
1098 if (*addr_exp >= '0' && *addr_exp <= '9')
1099 regnum = atoi (addr_exp); /* Take a number */
1100 if (regnum >= NUM_REGS) /* Bad name, or bad number */
1101 error ("%.*s: invalid register", end - addr_exp, addr_exp);
1102
1103found:
1104 DO_REGISTERS_INFO(regnum, fpregs);
1105
1106 addr_exp = end;
1107 while (*addr_exp == ' ' || *addr_exp == '\t')
1108 ++addr_exp;
1109 } while (*addr_exp != '\0');
ee0613d1
JG
1110}
1111
1112static void
1304f099 1113all_registers_info (addr_exp, from_tty)
ee0613d1 1114 char *addr_exp;
1304f099 1115 int from_tty;
ee0613d1
JG
1116{
1117 registers_info (addr_exp, 1);
1118}
1119
1120static void
1304f099 1121nofp_registers_info (addr_exp, from_tty)
ee0613d1 1122 char *addr_exp;
1304f099 1123 int from_tty;
ee0613d1
JG
1124{
1125 registers_info (addr_exp, 0);
bd5635a1
RP
1126}
1127\f
1128/*
1129 * TODO:
1130 * Should save/restore the tty state since it might be that the
1131 * program to be debugged was started on this tty and it wants
1132 * the tty in some state other than what we want. If it's running
1133 * on another terminal or without a terminal, then saving and
1134 * restoring the tty state is a harmless no-op.
1135 * This only needs to be done if we are attaching to a process.
1136 */
1137
1138/*
b5a3d2aa
SG
1139 attach_command --
1140 takes a program started up outside of gdb and ``attaches'' to it.
1141 This stops it cold in its tracks and allows us to start debugging it.
1142 and wait for the trace-trap that results from attaching. */
1143
bd5635a1
RP
1144void
1145attach_command (args, from_tty)
1146 char *args;
1147 int from_tty;
1148{
f266e564 1149 dont_repeat (); /* Not for the faint of heart */
b5a3d2aa
SG
1150
1151 if (target_has_execution)
1152 {
1153 if (query ("A program is being debugged already. Kill it? "))
1154 target_kill ();
1155 else
b1b4a89e 1156 error ("Not killed.");
b5a3d2aa
SG
1157 }
1158
bd5635a1 1159 target_attach (args, from_tty);
b5a3d2aa
SG
1160
1161 /* Set up the "saved terminal modes" of the inferior
1162 based on what modes we are starting it with. */
1163 target_terminal_init ();
1164
1165 /* Install inferior's terminal modes. */
1166 target_terminal_inferior ();
1167
1168 /* Set up execution context to know that we should return from
1169 wait_for_inferior as soon as the target reports a stop. */
1170 init_wait_for_inferior ();
1171 clear_proceed_status ();
1172 stop_soon_quietly = 1;
1173
9f577285
SS
1174#ifndef MACH
1175 /* Mach 3 does not generate any traps when attaching to inferior,
1176 and to set up frames we can do this. */
1177
b5a3d2aa 1178 wait_for_inferior ();
9f577285 1179#endif
b5a3d2aa
SG
1180
1181#ifdef SOLIB_ADD
1182 /* Add shared library symbols from the newly attached process, if any. */
1183 SOLIB_ADD ((char *)0, from_tty, (struct target_ops *)0);
1184#endif
1185
1186 normal_stop ();
bd5635a1
RP
1187}
1188
1189/*
1190 * detach_command --
1191 * takes a program previously attached to and detaches it.
1192 * The program resumes execution and will no longer stop
1193 * on signals, etc. We better not have left any breakpoints
1194 * in the program or it'll die when it hits one. For this
1195 * to work, it may be necessary for the process to have been
1196 * previously attached. It *might* work if the program was
1197 * started via the normal ptrace (PTRACE_TRACEME).
1198 */
1199
1200static void
1201detach_command (args, from_tty)
1202 char *args;
1203 int from_tty;
1204{
f266e564 1205 dont_repeat (); /* Not for the faint of heart */
bd5635a1
RP
1206 target_detach (args, from_tty);
1207}
1208
1209/* ARGSUSED */
1210static void
1304f099 1211float_info (addr_exp, from_tty)
bd5635a1 1212 char *addr_exp;
1304f099 1213 int from_tty;
bd5635a1
RP
1214{
1215#ifdef FLOAT_INFO
1216 FLOAT_INFO;
1217#else
1304f099 1218 printf_filtered ("No floating point info available for this processor.\n");
bd5635a1
RP
1219#endif
1220}
1221\f
f266e564
JK
1222/* ARGSUSED */
1223static void
1224unset_command (args, from_tty)
1225 char *args;
1226 int from_tty;
1227{
1304f099 1228 printf_filtered ("\"unset\" must be followed by the name of an unset subcommand.\n");
199b2450 1229 help_list (unsetlist, "unset ", -1, gdb_stdout);
f266e564
JK
1230}
1231
bd5635a1
RP
1232void
1233_initialize_infcmd ()
1234{
1235 struct cmd_list_element *c;
1236
1237 add_com ("tty", class_run, tty_command,
1238 "Set terminal for future runs of program being debugged.");
1239
1240 add_show_from_set
1241 (add_set_cmd ("args", class_run, var_string_noescape, (char *)&inferior_args,
1242
1243"Set arguments to give program being debugged when it is started.\n\
1244Follow this command with any number of args, to be passed to the program.",
1245 &setlist),
1246 &showlist);
1247
1248 c = add_cmd
1249 ("environment", no_class, environment_info,
1250 "The environment to give the program, or one variable's value.\n\
1251With an argument VAR, prints the value of environment variable VAR to\n\
1252give the program being debugged. With no arguments, prints the entire\n\
1253environment to be given to the program.", &showlist);
1254 c->completer = noop_completer;
1255
f266e564
JK
1256 add_prefix_cmd ("unset", no_class, unset_command,
1257 "Complement to certain \"set\" commands",
1258 &unsetlist, "unset ", 0, &cmdlist);
1259
bd5635a1
RP
1260 c = add_cmd ("environment", class_run, unset_environment_command,
1261 "Cancel environment variable VAR for the program.\n\
1262This does not affect the program until the next \"run\" command.",
f266e564 1263 &unsetlist);
bd5635a1
RP
1264 c->completer = noop_completer;
1265
1266 c = add_cmd ("environment", class_run, set_environment_command,
1267 "Set environment variable value to give the program.\n\
1268Arguments are VAR VALUE where VAR is variable name and VALUE is value.\n\
1269VALUES of environment variables are uninterpreted strings.\n\
1270This does not affect the program until the next \"run\" command.",
1271 &setlist);
1272 c->completer = noop_completer;
1273
1274 add_com ("path", class_files, path_command,
1275 "Add directory DIR(s) to beginning of search path for object files.\n\
1276$cwd in the path means the current working directory.\n\
1277This path is equivalent to the $PATH shell variable. It is a list of\n\
1278directories, separated by colons. These directories are searched to find\n\
1279fully linked executable files and separately compiled object files as needed.");
1280
ee0613d1 1281 c = add_cmd ("paths", no_class, path_info,
bd5635a1
RP
1282 "Current search path for finding object files.\n\
1283$cwd in the path means the current working directory.\n\
1284This path is equivalent to the $PATH shell variable. It is a list of\n\
1285directories, separated by colons. These directories are searched to find\n\
ee0613d1
JG
1286fully linked executable files and separately compiled object files as needed.", &showlist);
1287 c->completer = noop_completer;
bd5635a1
RP
1288
1289 add_com ("attach", class_run, attach_command,
1290 "Attach to a process or file outside of GDB.\n\
1291This command attaches to another target, of the same type as your last\n\
1292`target' command (`info files' will show your target stack).\n\
1293The command may take as argument a process id or a device file.\n\
1294For a process id, you must have permission to send the process a signal,\n\
1295and it must have the same effective uid as the debugger.\n\
1296When using \"attach\", you should use the \"file\" command to specify\n\
1297the program running in the process, and to load its symbol table.");
1298
1299 add_com ("detach", class_run, detach_command,
1300 "Detach a process or file previously attached.\n\
1301If a process, it is no longer traced, and it continues its execution. If you\n\
1302were debugging a file, the file is closed and gdb no longer accesses it.");
1303
1304 add_com ("signal", class_run, signal_command,
1305 "Continue program giving it signal number SIGNUMBER.");
1306
1307 add_com ("stepi", class_run, stepi_command,
1308 "Step one instruction exactly.\n\
1309Argument N means do this N times (or till program stops for another reason).");
1310 add_com_alias ("si", "stepi", class_alias, 0);
1311
1312 add_com ("nexti", class_run, nexti_command,
1313 "Step one instruction, but proceed through subroutine calls.\n\
1314Argument N means do this N times (or till program stops for another reason).");
1315 add_com_alias ("ni", "nexti", class_alias, 0);
1316
1317 add_com ("finish", class_run, finish_command,
1318 "Execute until selected stack frame returns.\n\
1319Upon return, the value returned is printed and put in the value history.");
1320
1321 add_com ("next", class_run, next_command,
1322 "Step program, proceeding through subroutine calls.\n\
1323Like the \"step\" command as long as subroutine calls do not happen;\n\
1324when they do, the call is treated as one instruction.\n\
1325Argument N means do this N times (or till program stops for another reason).");
1326 add_com_alias ("n", "next", class_run, 1);
1327
1328 add_com ("step", class_run, step_command,
1329 "Step program until it reaches a different source line.\n\
1330Argument N means do this N times (or till program stops for another reason).");
1331 add_com_alias ("s", "step", class_run, 1);
1332
1333 add_com ("until", class_run, until_command,
1334 "Execute until the program reaches a source line greater than the current\n\
1335or a specified line or address or function (same args as break command).\n\
1336Execution will also stop upon exit from the current stack frame.");
1337 add_com_alias ("u", "until", class_run, 1);
1338
1339 add_com ("jump", class_run, jump_command,
1340 "Continue program being debugged at specified line or address.\n\
1341Give as argument either LINENUM or *ADDR, where ADDR is an expression\n\
1342for an address to start at.");
1343
1344 add_com ("continue", class_run, continue_command,
1345 "Continue program being debugged, after signal or breakpoint.\n\
de6a2704
JK
1346If proceeding from breakpoint, a number N may be used as an argument,\n\
1347which means to set the ignore count of that breakpoint to N - 1 (so that\n\
1348the breakpoint won't break until the Nth time it is reached).");
bd5635a1
RP
1349 add_com_alias ("c", "cont", class_run, 1);
1350 add_com_alias ("fg", "cont", class_run, 1);
1351
1352 add_com ("run", class_run, run_command,
1353 "Start debugged program. You may specify arguments to give it.\n\
1354Args may include \"*\", or \"[...]\"; they are expanded using \"sh\".\n\
1355Input and output redirection with \">\", \"<\", or \">>\" are also allowed.\n\n\
b4fde6fa 1356With no arguments, uses arguments last specified (with \"run\" or \"set args\").\n\
bd5635a1
RP
1357To cancel previous arguments and run with no arguments,\n\
1358use \"set args\" without arguments.");
1359 add_com_alias ("r", "run", class_run, 1);
1360
ee0613d1
JG
1361 add_info ("registers", nofp_registers_info,
1362 "List of integer registers and their contents, for selected stack frame.\n\
1363Register name as argument means describe only that register.");
1364
1365 add_info ("all-registers", all_registers_info,
1366"List of all registers and their contents, for selected stack frame.\n\
bd5635a1
RP
1367Register name as argument means describe only that register.");
1368
1369 add_info ("program", program_info,
1370 "Execution status of the program.");
1371
1372 add_info ("float", float_info,
1373 "Print the status of the floating point unit\n");
1374
1375 inferior_args = savestring ("", 1); /* Initially no args */
1376 inferior_environ = make_environ ();
1377 init_environ (inferior_environ);
1378}
This page took 0.225014 seconds and 4 git commands to generate.