fix typo in previous commit
[deliverable/binutils-gdb.git] / gdb / infcmd.c
1 /* Memory-access and commands for "inferior" process, for GDB.
2
3 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
4 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
5 Free Software Foundation, Inc.
6
7 This file is part of GDB.
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 Boston, MA 02110-1301, USA. */
23
24 #include "defs.h"
25 #include <signal.h>
26 #include "gdb_string.h"
27 #include "symtab.h"
28 #include "gdbtypes.h"
29 #include "frame.h"
30 #include "inferior.h"
31 #include "environ.h"
32 #include "value.h"
33 #include "gdbcmd.h"
34 #include "symfile.h"
35 #include "gdbcore.h"
36 #include "target.h"
37 #include "language.h"
38 #include "symfile.h"
39 #include "objfiles.h"
40 #include "completer.h"
41 #include "ui-out.h"
42 #include "event-top.h"
43 #include "parser-defs.h"
44 #include "regcache.h"
45 #include "reggroups.h"
46 #include "block.h"
47 #include "solib.h"
48 #include <ctype.h>
49 #include "gdb_assert.h"
50 #include "observer.h"
51 #include "target-descriptions.h"
52
53 /* Functions exported for general use, in inferior.h: */
54
55 void all_registers_info (char *, int);
56
57 void registers_info (char *, int);
58
59 void nexti_command (char *, int);
60
61 void stepi_command (char *, int);
62
63 void continue_command (char *, int);
64
65 void interrupt_target_command (char *args, int from_tty);
66
67 /* Local functions: */
68
69 static void nofp_registers_info (char *, int);
70
71 static void print_return_value (int struct_return, struct type *value_type);
72
73 static void finish_command_continuation (struct continuation_arg *);
74
75 static void until_next_command (int);
76
77 static void until_command (char *, int);
78
79 static void path_info (char *, int);
80
81 static void path_command (char *, int);
82
83 static void unset_command (char *, int);
84
85 static void float_info (char *, int);
86
87 static void detach_command (char *, int);
88
89 static void disconnect_command (char *, int);
90
91 static void unset_environment_command (char *, int);
92
93 static void set_environment_command (char *, int);
94
95 static void environment_info (char *, int);
96
97 static void program_info (char *, int);
98
99 static void finish_command (char *, int);
100
101 static void signal_command (char *, int);
102
103 static void jump_command (char *, int);
104
105 static void step_1 (int, int, char *);
106 static void step_once (int skip_subroutines, int single_inst, int count);
107 static void step_1_continuation (struct continuation_arg *arg);
108
109 static void next_command (char *, int);
110
111 static void step_command (char *, int);
112
113 static void run_command (char *, int);
114
115 static void run_no_args_command (char *args, int from_tty);
116
117 static void go_command (char *line_no, int from_tty);
118
119 static int strip_bg_char (char **);
120
121 void _initialize_infcmd (void);
122
123 #define GO_USAGE "Usage: go <location>\n"
124
125 #define ERROR_NO_INFERIOR \
126 if (!target_has_execution) error (_("The program is not being run."));
127
128 /* String containing arguments to give to the program, separated by spaces.
129 Empty string (pointer to '\0') means no args. */
130
131 static char *inferior_args;
132
133 /* The inferior arguments as a vector. If INFERIOR_ARGC is nonzero,
134 then we must compute INFERIOR_ARGS from this (via the target). */
135
136 static int inferior_argc;
137 static char **inferior_argv;
138
139 /* File name for default use for standard in/out in the inferior. */
140
141 static char *inferior_io_terminal;
142
143 /* Pid of our debugged inferior, or 0 if no inferior now.
144 Since various parts of infrun.c test this to see whether there is a program
145 being debugged it should be nonzero (currently 3 is used) for remote
146 debugging. */
147
148 ptid_t inferior_ptid;
149
150 /* Last signal that the inferior received (why it stopped). */
151
152 enum target_signal stop_signal;
153
154 /* Address at which inferior stopped. */
155
156 CORE_ADDR stop_pc;
157
158 /* Chain containing status of breakpoint(s) that we have stopped at. */
159
160 bpstat stop_bpstat;
161
162 /* Flag indicating that a command has proceeded the inferior past the
163 current breakpoint. */
164
165 int breakpoint_proceeded;
166
167 /* Nonzero if stopped due to a step command. */
168
169 int stop_step;
170
171 /* Nonzero if stopped due to completion of a stack dummy routine. */
172
173 int stop_stack_dummy;
174
175 /* Nonzero if stopped due to a random (unexpected) signal in inferior
176 process. */
177
178 int stopped_by_random_signal;
179
180 /* Range to single step within.
181 If this is nonzero, respond to a single-step signal
182 by continuing to step if the pc is in this range. */
183
184 CORE_ADDR step_range_start; /* Inclusive */
185 CORE_ADDR step_range_end; /* Exclusive */
186
187 /* Stack frame address as of when stepping command was issued.
188 This is how we know when we step into a subroutine call,
189 and how to set the frame for the breakpoint used to step out. */
190
191 struct frame_id step_frame_id;
192
193 enum step_over_calls_kind step_over_calls;
194
195 /* If stepping, nonzero means step count is > 1
196 so don't print frame next time inferior stops
197 if it stops due to stepping. */
198
199 int step_multi;
200
201 /* Environment to use for running inferior,
202 in format described in environ.h. */
203
204 struct gdb_environ *inferior_environ;
205 \f
206 /* Accessor routines. */
207
208 void
209 set_inferior_io_terminal (const char *terminal_name)
210 {
211 if (inferior_io_terminal)
212 xfree (inferior_io_terminal);
213
214 if (!terminal_name)
215 inferior_io_terminal = NULL;
216 else
217 inferior_io_terminal = savestring (terminal_name, strlen (terminal_name));
218 }
219
220 const char *
221 get_inferior_io_terminal (void)
222 {
223 return inferior_io_terminal;
224 }
225
226 char *
227 get_inferior_args (void)
228 {
229 if (inferior_argc != 0)
230 {
231 char *n, *old;
232
233 n = gdbarch_construct_inferior_arguments (current_gdbarch,
234 inferior_argc, inferior_argv);
235 old = set_inferior_args (n);
236 xfree (old);
237 }
238
239 if (inferior_args == NULL)
240 inferior_args = xstrdup ("");
241
242 return inferior_args;
243 }
244
245 char *
246 set_inferior_args (char *newargs)
247 {
248 char *saved_args = inferior_args;
249
250 inferior_args = newargs;
251 inferior_argc = 0;
252 inferior_argv = 0;
253
254 return saved_args;
255 }
256
257 void
258 set_inferior_args_vector (int argc, char **argv)
259 {
260 inferior_argc = argc;
261 inferior_argv = argv;
262 }
263
264 /* Notice when `set args' is run. */
265 static void
266 notice_args_set (char *args, int from_tty, struct cmd_list_element *c)
267 {
268 inferior_argc = 0;
269 inferior_argv = 0;
270 }
271
272 /* Notice when `show args' is run. */
273 static void
274 notice_args_read (struct ui_file *file, int from_tty,
275 struct cmd_list_element *c, const char *value)
276 {
277 deprecated_show_value_hack (file, from_tty, c, value);
278 /* Might compute the value. */
279 get_inferior_args ();
280 }
281
282 \f
283 /* Compute command-line string given argument vector. This does the
284 same shell processing as fork_inferior. */
285 char *
286 construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
287 {
288 char *result;
289
290 if (STARTUP_WITH_SHELL)
291 {
292 /* This holds all the characters considered special to the
293 typical Unix shells. We include `^' because the SunOS
294 /bin/sh treats it as a synonym for `|'. */
295 char *special = "\"!#$&*()\\|[]{}<>?'\"`~^; \t\n";
296 int i;
297 int length = 0;
298 char *out, *cp;
299
300 /* We over-compute the size. It shouldn't matter. */
301 for (i = 0; i < argc; ++i)
302 length += 2 * strlen (argv[i]) + 1 + 2 * (argv[i][0] == '\0');
303
304 result = (char *) xmalloc (length);
305 out = result;
306
307 for (i = 0; i < argc; ++i)
308 {
309 if (i > 0)
310 *out++ = ' ';
311
312 /* Need to handle empty arguments specially. */
313 if (argv[i][0] == '\0')
314 {
315 *out++ = '\'';
316 *out++ = '\'';
317 }
318 else
319 {
320 for (cp = argv[i]; *cp; ++cp)
321 {
322 if (strchr (special, *cp) != NULL)
323 *out++ = '\\';
324 *out++ = *cp;
325 }
326 }
327 }
328 *out = '\0';
329 }
330 else
331 {
332 /* In this case we can't handle arguments that contain spaces,
333 tabs, or newlines -- see breakup_args(). */
334 int i;
335 int length = 0;
336
337 for (i = 0; i < argc; ++i)
338 {
339 char *cp = strchr (argv[i], ' ');
340 if (cp == NULL)
341 cp = strchr (argv[i], '\t');
342 if (cp == NULL)
343 cp = strchr (argv[i], '\n');
344 if (cp != NULL)
345 error (_("can't handle command-line argument containing whitespace"));
346 length += strlen (argv[i]) + 1;
347 }
348
349 result = (char *) xmalloc (length);
350 result[0] = '\0';
351 for (i = 0; i < argc; ++i)
352 {
353 if (i > 0)
354 strcat (result, " ");
355 strcat (result, argv[i]);
356 }
357 }
358
359 return result;
360 }
361 \f
362
363 /* This function detects whether or not a '&' character (indicating
364 background execution) has been added as *the last* of the arguments ARGS
365 of a command. If it has, it removes it and returns 1. Otherwise it
366 does nothing and returns 0. */
367 static int
368 strip_bg_char (char **args)
369 {
370 char *p = NULL;
371
372 p = strchr (*args, '&');
373
374 if (p)
375 {
376 if (p == (*args + strlen (*args) - 1))
377 {
378 if (strlen (*args) > 1)
379 {
380 do
381 p--;
382 while (*p == ' ' || *p == '\t');
383 *(p + 1) = '\0';
384 }
385 else
386 *args = 0;
387 return 1;
388 }
389 }
390 return 0;
391 }
392
393 void
394 tty_command (char *file, int from_tty)
395 {
396 if (file == 0)
397 error_no_arg (_("terminal name for running target process"));
398
399 set_inferior_io_terminal (file);
400 }
401
402 /* Common actions to take after creating any sort of inferior, by any
403 means (running, attaching, connecting, et cetera). The target
404 should be stopped. */
405
406 void
407 post_create_inferior (struct target_ops *target, int from_tty)
408 {
409 /* If the target hasn't taken care of this already, do it now.
410 Targets which need to access registers during to_open,
411 to_create_inferior, or to_attach should do it earlier; but many
412 don't need to. */
413 target_find_description ();
414
415 if (exec_bfd)
416 {
417 /* Sometimes the platform-specific hook loads initial shared
418 libraries, and sometimes it doesn't. Try to do so first, so
419 that we can add them with the correct value for FROM_TTY. */
420 #ifdef SOLIB_ADD
421 SOLIB_ADD (NULL, from_tty, target, auto_solib_add);
422 #else
423 solib_add (NULL, from_tty, target, auto_solib_add);
424 #endif
425
426 /* Create the hooks to handle shared library load and unload
427 events. */
428 #ifdef SOLIB_CREATE_INFERIOR_HOOK
429 SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid));
430 #else
431 solib_create_inferior_hook ();
432 #endif
433
434 /* Enable any breakpoints which were disabled when the
435 underlying shared library was deleted. */
436 re_enable_breakpoints_in_shlibs ();
437 }
438
439 observer_notify_inferior_created (target, from_tty);
440 }
441
442 /* Kill the inferior if already running. This function is designed
443 to be called when we are about to start the execution of the program
444 from the beginning. Ask the user to confirm that he wants to restart
445 the program being debugged when FROM_TTY is non-null. */
446
447 void
448 kill_if_already_running (int from_tty)
449 {
450 if (! ptid_equal (inferior_ptid, null_ptid) && target_has_execution)
451 {
452 if (from_tty
453 && !query ("The program being debugged has been started already.\n\
454 Start it from the beginning? "))
455 error (_("Program not restarted."));
456 target_kill ();
457 #if defined(SOLIB_RESTART)
458 SOLIB_RESTART ();
459 #endif
460 init_wait_for_inferior ();
461 }
462 }
463
464 /* Implement the "run" command. If TBREAK_AT_MAIN is set, then insert
465 a temporary breakpoint at the begining of the main program before
466 running the program. */
467
468 static void
469 run_command_1 (char *args, int from_tty, int tbreak_at_main)
470 {
471 char *exec_file;
472
473 dont_repeat ();
474
475 kill_if_already_running (from_tty);
476 clear_breakpoint_hit_counts ();
477
478 /* Clean up any leftovers from other runs. Some other things from
479 this function should probably be moved into target_pre_inferior. */
480 target_pre_inferior (from_tty);
481
482 /* Purge old solib objfiles. */
483 objfile_purge_solibs ();
484
485 do_run_cleanups (NULL);
486
487 /* The comment here used to read, "The exec file is re-read every
488 time we do a generic_mourn_inferior, so we just have to worry
489 about the symbol file." The `generic_mourn_inferior' function
490 gets called whenever the program exits. However, suppose the
491 program exits, and *then* the executable file changes? We need
492 to check again here. Since reopen_exec_file doesn't do anything
493 if the timestamp hasn't changed, I don't see the harm. */
494 reopen_exec_file ();
495 reread_symbols ();
496
497 /* Insert the temporary breakpoint if a location was specified. */
498 if (tbreak_at_main)
499 tbreak_command (main_name (), 0);
500
501 exec_file = (char *) get_exec_file (0);
502
503 /* We keep symbols from add-symbol-file, on the grounds that the
504 user might want to add some symbols before running the program
505 (right?). But sometimes (dynamic loading where the user manually
506 introduces the new symbols with add-symbol-file), the code which
507 the symbols describe does not persist between runs. Currently
508 the user has to manually nuke all symbols between runs if they
509 want them to go away (PR 2207). This is probably reasonable. */
510
511 if (!args)
512 {
513 if (target_can_async_p ())
514 async_disable_stdin ();
515 }
516 else
517 {
518 int async_exec = strip_bg_char (&args);
519
520 /* If we get a request for running in the bg but the target
521 doesn't support it, error out. */
522 if (async_exec && !target_can_async_p ())
523 error (_("Asynchronous execution not supported on this target."));
524
525 /* If we don't get a request of running in the bg, then we need
526 to simulate synchronous (fg) execution. */
527 if (!async_exec && target_can_async_p ())
528 {
529 /* Simulate synchronous execution */
530 async_disable_stdin ();
531 }
532
533 /* If there were other args, beside '&', process them. */
534 if (args)
535 {
536 char *old_args = set_inferior_args (xstrdup (args));
537 xfree (old_args);
538 }
539 }
540
541 if (from_tty)
542 {
543 ui_out_field_string (uiout, NULL, "Starting program");
544 ui_out_text (uiout, ": ");
545 if (exec_file)
546 ui_out_field_string (uiout, "execfile", exec_file);
547 ui_out_spaces (uiout, 1);
548 /* We call get_inferior_args() because we might need to compute
549 the value now. */
550 ui_out_field_string (uiout, "infargs", get_inferior_args ());
551 ui_out_text (uiout, "\n");
552 ui_out_flush (uiout);
553 }
554
555 /* We call get_inferior_args() because we might need to compute
556 the value now. */
557 target_create_inferior (exec_file, get_inferior_args (),
558 environ_vector (inferior_environ), from_tty);
559
560 post_create_inferior (&current_target, from_tty);
561
562 /* Start the target running. */
563 proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
564 }
565
566
567 static void
568 run_command (char *args, int from_tty)
569 {
570 run_command_1 (args, from_tty, 0);
571 }
572
573 static void
574 run_no_args_command (char *args, int from_tty)
575 {
576 char *old_args = set_inferior_args (xstrdup (""));
577 xfree (old_args);
578 }
579 \f
580
581 /* Start the execution of the program up until the beginning of the main
582 program. */
583
584 static void
585 start_command (char *args, int from_tty)
586 {
587 /* Some languages such as Ada need to search inside the program
588 minimal symbols for the location where to put the temporary
589 breakpoint before starting. */
590 if (!have_minimal_symbols ())
591 error (_("No symbol table loaded. Use the \"file\" command."));
592
593 /* Run the program until reaching the main procedure... */
594 run_command_1 (args, from_tty, 1);
595 }
596
597 void
598 continue_command (char *proc_count_exp, int from_tty)
599 {
600 int async_exec = 0;
601 ERROR_NO_INFERIOR;
602
603 /* Find out whether we must run in the background. */
604 if (proc_count_exp != NULL)
605 async_exec = strip_bg_char (&proc_count_exp);
606
607 /* If we must run in the background, but the target can't do it,
608 error out. */
609 if (async_exec && !target_can_async_p ())
610 error (_("Asynchronous execution not supported on this target."));
611
612 /* If we are not asked to run in the bg, then prepare to run in the
613 foreground, synchronously. */
614 if (!async_exec && target_can_async_p ())
615 {
616 /* Simulate synchronous execution */
617 async_disable_stdin ();
618 }
619
620 /* If have argument (besides '&'), set proceed count of breakpoint
621 we stopped at. */
622 if (proc_count_exp != NULL)
623 {
624 bpstat bs = stop_bpstat;
625 int num, stat;
626 int stopped = 0;
627
628 while ((stat = bpstat_num (&bs, &num)) != 0)
629 if (stat > 0)
630 {
631 set_ignore_count (num,
632 parse_and_eval_long (proc_count_exp) - 1,
633 from_tty);
634 /* set_ignore_count prints a message ending with a period.
635 So print two spaces before "Continuing.". */
636 if (from_tty)
637 printf_filtered (" ");
638 stopped = 1;
639 }
640
641 if (!stopped && from_tty)
642 {
643 printf_filtered
644 ("Not stopped at any breakpoint; argument ignored.\n");
645 }
646 }
647
648 if (from_tty)
649 printf_filtered (_("Continuing.\n"));
650
651 clear_proceed_status ();
652
653 proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
654 }
655 \f
656 /* Step until outside of current statement. */
657
658 static void
659 step_command (char *count_string, int from_tty)
660 {
661 step_1 (0, 0, count_string);
662 }
663
664 /* Likewise, but skip over subroutine calls as if single instructions. */
665
666 static void
667 next_command (char *count_string, int from_tty)
668 {
669 step_1 (1, 0, count_string);
670 }
671
672 /* Likewise, but step only one instruction. */
673
674 void
675 stepi_command (char *count_string, int from_tty)
676 {
677 step_1 (0, 1, count_string);
678 }
679
680 void
681 nexti_command (char *count_string, int from_tty)
682 {
683 step_1 (1, 1, count_string);
684 }
685
686 static void
687 disable_longjmp_breakpoint_cleanup (void *ignore)
688 {
689 disable_longjmp_breakpoint ();
690 }
691
692 static void
693 step_1 (int skip_subroutines, int single_inst, char *count_string)
694 {
695 int count = 1;
696 struct frame_info *frame;
697 struct cleanup *cleanups = 0;
698 int async_exec = 0;
699
700 ERROR_NO_INFERIOR;
701
702 if (count_string)
703 async_exec = strip_bg_char (&count_string);
704
705 /* If we get a request for running in the bg but the target
706 doesn't support it, error out. */
707 if (async_exec && !target_can_async_p ())
708 error (_("Asynchronous execution not supported on this target."));
709
710 /* If we don't get a request of running in the bg, then we need
711 to simulate synchronous (fg) execution. */
712 if (!async_exec && target_can_async_p ())
713 {
714 /* Simulate synchronous execution */
715 async_disable_stdin ();
716 }
717
718 count = count_string ? parse_and_eval_long (count_string) : 1;
719
720 if (!single_inst || skip_subroutines) /* leave si command alone */
721 {
722 enable_longjmp_breakpoint ();
723 if (!target_can_async_p ())
724 cleanups = make_cleanup (disable_longjmp_breakpoint_cleanup, 0 /*ignore*/);
725 else
726 make_exec_cleanup (disable_longjmp_breakpoint_cleanup, 0 /*ignore*/);
727 }
728
729 /* In synchronous case, all is well, just use the regular for loop. */
730 if (!target_can_async_p ())
731 {
732 for (; count > 0; count--)
733 {
734 clear_proceed_status ();
735
736 frame = get_current_frame ();
737 if (!frame) /* Avoid coredump here. Why tho? */
738 error (_("No current frame"));
739 step_frame_id = get_frame_id (frame);
740
741 if (!single_inst)
742 {
743 find_pc_line_pc_range (stop_pc, &step_range_start, &step_range_end);
744 if (step_range_end == 0)
745 {
746 char *name;
747 if (find_pc_partial_function (stop_pc, &name, &step_range_start,
748 &step_range_end) == 0)
749 error (_("Cannot find bounds of current function"));
750
751 target_terminal_ours ();
752 printf_filtered (_("\
753 Single stepping until exit from function %s, \n\
754 which has no line number information.\n"), name);
755 }
756 }
757 else
758 {
759 /* Say we are stepping, but stop after one insn whatever it does. */
760 step_range_start = step_range_end = 1;
761 if (!skip_subroutines)
762 /* It is stepi.
763 Don't step over function calls, not even to functions lacking
764 line numbers. */
765 step_over_calls = STEP_OVER_NONE;
766 }
767
768 if (skip_subroutines)
769 step_over_calls = STEP_OVER_ALL;
770
771 step_multi = (count > 1);
772 proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
773
774 if (!stop_step)
775 break;
776 }
777
778 if (!single_inst || skip_subroutines)
779 do_cleanups (cleanups);
780 return;
781 }
782 /* In case of asynchronous target things get complicated, do only
783 one step for now, before returning control to the event loop. Let
784 the continuation figure out how many other steps we need to do,
785 and handle them one at the time, through step_once(). */
786 else
787 {
788 if (target_can_async_p ())
789 step_once (skip_subroutines, single_inst, count);
790 }
791 }
792
793 /* Called after we are done with one step operation, to check whether
794 we need to step again, before we print the prompt and return control
795 to the user. If count is > 1, we will need to do one more call to
796 proceed(), via step_once(). Basically it is like step_once and
797 step_1_continuation are co-recursive. */
798 static void
799 step_1_continuation (struct continuation_arg *arg)
800 {
801 int count;
802 int skip_subroutines;
803 int single_inst;
804
805 skip_subroutines = arg->data.integer;
806 single_inst = arg->next->data.integer;
807 count = arg->next->next->data.integer;
808
809 if (stop_step)
810 step_once (skip_subroutines, single_inst, count - 1);
811 else
812 if (!single_inst || skip_subroutines)
813 do_exec_cleanups (ALL_CLEANUPS);
814 }
815
816 /* Do just one step operation. If count >1 we will have to set up a
817 continuation to be done after the target stops (after this one
818 step). This is useful to implement the 'step n' kind of commands, in
819 case of asynchronous targets. We had to split step_1 into two parts,
820 one to be done before proceed() and one afterwards. This function is
821 called in case of step n with n>1, after the first step operation has
822 been completed.*/
823 static void
824 step_once (int skip_subroutines, int single_inst, int count)
825 {
826 struct continuation_arg *arg1;
827 struct continuation_arg *arg2;
828 struct continuation_arg *arg3;
829 struct frame_info *frame;
830
831 if (count > 0)
832 {
833 clear_proceed_status ();
834
835 frame = get_current_frame ();
836 if (!frame) /* Avoid coredump here. Why tho? */
837 error (_("No current frame"));
838 step_frame_id = get_frame_id (frame);
839
840 if (!single_inst)
841 {
842 find_pc_line_pc_range (stop_pc, &step_range_start, &step_range_end);
843
844 /* If we have no line info, switch to stepi mode. */
845 if (step_range_end == 0 && step_stop_if_no_debug)
846 {
847 step_range_start = step_range_end = 1;
848 }
849 else if (step_range_end == 0)
850 {
851 char *name;
852 if (find_pc_partial_function (stop_pc, &name, &step_range_start,
853 &step_range_end) == 0)
854 error (_("Cannot find bounds of current function"));
855
856 target_terminal_ours ();
857 printf_filtered (_("\
858 Single stepping until exit from function %s, \n\
859 which has no line number information.\n"), name);
860 }
861 }
862 else
863 {
864 /* Say we are stepping, but stop after one insn whatever it does. */
865 step_range_start = step_range_end = 1;
866 if (!skip_subroutines)
867 /* It is stepi.
868 Don't step over function calls, not even to functions lacking
869 line numbers. */
870 step_over_calls = STEP_OVER_NONE;
871 }
872
873 if (skip_subroutines)
874 step_over_calls = STEP_OVER_ALL;
875
876 step_multi = (count > 1);
877 arg1 =
878 (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
879 arg2 =
880 (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
881 arg3 =
882 (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
883 arg1->next = arg2;
884 arg1->data.integer = skip_subroutines;
885 arg2->next = arg3;
886 arg2->data.integer = single_inst;
887 arg3->next = NULL;
888 arg3->data.integer = count;
889 add_intermediate_continuation (step_1_continuation, arg1);
890 proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
891 }
892 }
893
894 \f
895 /* Continue program at specified address. */
896
897 static void
898 jump_command (char *arg, int from_tty)
899 {
900 CORE_ADDR addr;
901 struct symtabs_and_lines sals;
902 struct symtab_and_line sal;
903 struct symbol *fn;
904 struct symbol *sfn;
905 int async_exec = 0;
906
907 ERROR_NO_INFERIOR;
908
909 /* Find out whether we must run in the background. */
910 if (arg != NULL)
911 async_exec = strip_bg_char (&arg);
912
913 /* If we must run in the background, but the target can't do it,
914 error out. */
915 if (async_exec && !target_can_async_p ())
916 error (_("Asynchronous execution not supported on this target."));
917
918 /* If we are not asked to run in the bg, then prepare to run in the
919 foreground, synchronously. */
920 if (!async_exec && target_can_async_p ())
921 {
922 /* Simulate synchronous execution */
923 async_disable_stdin ();
924 }
925
926 if (!arg)
927 error_no_arg (_("starting address"));
928
929 sals = decode_line_spec_1 (arg, 1);
930 if (sals.nelts != 1)
931 {
932 error (_("Unreasonable jump request"));
933 }
934
935 sal = sals.sals[0];
936 xfree (sals.sals);
937
938 if (sal.symtab == 0 && sal.pc == 0)
939 error (_("No source file has been specified."));
940
941 resolve_sal_pc (&sal); /* May error out */
942
943 /* See if we are trying to jump to another function. */
944 fn = get_frame_function (get_current_frame ());
945 sfn = find_pc_function (sal.pc);
946 if (fn != NULL && sfn != fn)
947 {
948 if (!query ("Line %d is not in `%s'. Jump anyway? ", sal.line,
949 SYMBOL_PRINT_NAME (fn)))
950 {
951 error (_("Not confirmed."));
952 /* NOTREACHED */
953 }
954 }
955
956 if (sfn != NULL)
957 {
958 fixup_symbol_section (sfn, 0);
959 if (section_is_overlay (SYMBOL_BFD_SECTION (sfn)) &&
960 !section_is_mapped (SYMBOL_BFD_SECTION (sfn)))
961 {
962 if (!query ("WARNING!!! Destination is in unmapped overlay! Jump anyway? "))
963 {
964 error (_("Not confirmed."));
965 /* NOTREACHED */
966 }
967 }
968 }
969
970 addr = sal.pc;
971
972 if (from_tty)
973 {
974 printf_filtered (_("Continuing at "));
975 deprecated_print_address_numeric (addr, 1, gdb_stdout);
976 printf_filtered (".\n");
977 }
978
979 clear_proceed_status ();
980 proceed (addr, TARGET_SIGNAL_0, 0);
981 }
982 \f
983
984 /* Go to line or address in current procedure */
985 static void
986 go_command (char *line_no, int from_tty)
987 {
988 if (line_no == (char *) NULL || !*line_no)
989 printf_filtered (GO_USAGE);
990 else
991 {
992 tbreak_command (line_no, from_tty);
993 jump_command (line_no, from_tty);
994 }
995 }
996 \f
997
998 /* Continue program giving it specified signal. */
999
1000 static void
1001 signal_command (char *signum_exp, int from_tty)
1002 {
1003 enum target_signal oursig;
1004
1005 dont_repeat (); /* Too dangerous. */
1006 ERROR_NO_INFERIOR;
1007
1008 if (!signum_exp)
1009 error_no_arg (_("signal number"));
1010
1011 /* It would be even slicker to make signal names be valid expressions,
1012 (the type could be "enum $signal" or some such), then the user could
1013 assign them to convenience variables. */
1014 oursig = target_signal_from_name (signum_exp);
1015
1016 if (oursig == TARGET_SIGNAL_UNKNOWN)
1017 {
1018 /* No, try numeric. */
1019 int num = parse_and_eval_long (signum_exp);
1020
1021 if (num == 0)
1022 oursig = TARGET_SIGNAL_0;
1023 else
1024 oursig = target_signal_from_command (num);
1025 }
1026
1027 if (from_tty)
1028 {
1029 if (oursig == TARGET_SIGNAL_0)
1030 printf_filtered (_("Continuing with no signal.\n"));
1031 else
1032 printf_filtered (_("Continuing with signal %s.\n"),
1033 target_signal_to_name (oursig));
1034 }
1035
1036 clear_proceed_status ();
1037 /* "signal 0" should not get stuck if we are stopped at a breakpoint.
1038 FIXME: Neither should "signal foo" but when I tried passing
1039 (CORE_ADDR)-1 unconditionally I got a testsuite failure which I haven't
1040 tried to track down yet. */
1041 proceed (oursig == TARGET_SIGNAL_0 ? (CORE_ADDR) -1 : stop_pc, oursig, 0);
1042 }
1043
1044 /* Proceed until we reach a different source line with pc greater than
1045 our current one or exit the function. We skip calls in both cases.
1046
1047 Note that eventually this command should probably be changed so
1048 that only source lines are printed out when we hit the breakpoint
1049 we set. This may involve changes to wait_for_inferior and the
1050 proceed status code. */
1051
1052 static void
1053 until_next_command (int from_tty)
1054 {
1055 struct frame_info *frame;
1056 CORE_ADDR pc;
1057 struct symbol *func;
1058 struct symtab_and_line sal;
1059
1060 clear_proceed_status ();
1061
1062 frame = get_current_frame ();
1063
1064 /* Step until either exited from this function or greater
1065 than the current line (if in symbolic section) or pc (if
1066 not). */
1067
1068 pc = read_pc ();
1069 func = find_pc_function (pc);
1070
1071 if (!func)
1072 {
1073 struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (pc);
1074
1075 if (msymbol == NULL)
1076 error (_("Execution is not within a known function."));
1077
1078 step_range_start = SYMBOL_VALUE_ADDRESS (msymbol);
1079 step_range_end = pc;
1080 }
1081 else
1082 {
1083 sal = find_pc_line (pc, 0);
1084
1085 step_range_start = BLOCK_START (SYMBOL_BLOCK_VALUE (func));
1086 step_range_end = sal.end;
1087 }
1088
1089 step_over_calls = STEP_OVER_ALL;
1090 step_frame_id = get_frame_id (frame);
1091
1092 step_multi = 0; /* Only one call to proceed */
1093
1094 proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
1095 }
1096
1097 static void
1098 until_command (char *arg, int from_tty)
1099 {
1100 int async_exec = 0;
1101
1102 if (!target_has_execution)
1103 error (_("The program is not running."));
1104
1105 /* Find out whether we must run in the background. */
1106 if (arg != NULL)
1107 async_exec = strip_bg_char (&arg);
1108
1109 /* If we must run in the background, but the target can't do it,
1110 error out. */
1111 if (async_exec && !target_can_async_p ())
1112 error (_("Asynchronous execution not supported on this target."));
1113
1114 /* If we are not asked to run in the bg, then prepare to run in the
1115 foreground, synchronously. */
1116 if (!async_exec && target_can_async_p ())
1117 {
1118 /* Simulate synchronous execution */
1119 async_disable_stdin ();
1120 }
1121
1122 if (arg)
1123 until_break_command (arg, from_tty, 0);
1124 else
1125 until_next_command (from_tty);
1126 }
1127
1128 static void
1129 advance_command (char *arg, int from_tty)
1130 {
1131 int async_exec = 0;
1132
1133 if (!target_has_execution)
1134 error (_("The program is not running."));
1135
1136 if (arg == NULL)
1137 error_no_arg (_("a location"));
1138
1139 /* Find out whether we must run in the background. */
1140 if (arg != NULL)
1141 async_exec = strip_bg_char (&arg);
1142
1143 /* If we must run in the background, but the target can't do it,
1144 error out. */
1145 if (async_exec && !target_can_async_p ())
1146 error (_("Asynchronous execution not supported on this target."));
1147
1148 /* If we are not asked to run in the bg, then prepare to run in the
1149 foreground, synchronously. */
1150 if (!async_exec && target_can_async_p ())
1151 {
1152 /* Simulate synchronous execution. */
1153 async_disable_stdin ();
1154 }
1155
1156 until_break_command (arg, from_tty, 1);
1157 }
1158 \f
1159 /* Print the result of a function at the end of a 'finish' command. */
1160
1161 static void
1162 print_return_value (int struct_return, struct type *value_type)
1163 {
1164 struct gdbarch *gdbarch = current_gdbarch;
1165 struct cleanup *old_chain;
1166 struct ui_stream *stb;
1167 struct value *value;
1168
1169 CHECK_TYPEDEF (value_type);
1170 gdb_assert (TYPE_CODE (value_type) != TYPE_CODE_VOID);
1171
1172 /* FIXME: 2003-09-27: When returning from a nested inferior function
1173 call, it's possible (with no help from the architecture vector)
1174 to locate and return/print a "struct return" value. This is just
1175 a more complicated case of what is already being done in in the
1176 inferior function call code. In fact, when inferior function
1177 calls are made async, this will likely be made the norm. */
1178
1179 switch (gdbarch_return_value (gdbarch, value_type, NULL, NULL, NULL))
1180 {
1181 case RETURN_VALUE_REGISTER_CONVENTION:
1182 case RETURN_VALUE_ABI_RETURNS_ADDRESS:
1183 case RETURN_VALUE_ABI_PRESERVES_ADDRESS:
1184 value = allocate_value (value_type);
1185 gdbarch_return_value (current_gdbarch, value_type, stop_registers,
1186 value_contents_raw (value), NULL);
1187 break;
1188 case RETURN_VALUE_STRUCT_CONVENTION:
1189 value = NULL;
1190 break;
1191 default:
1192 internal_error (__FILE__, __LINE__, _("bad switch"));
1193 }
1194
1195 if (value)
1196 {
1197 /* Print it. */
1198 stb = ui_out_stream_new (uiout);
1199 old_chain = make_cleanup_ui_out_stream_delete (stb);
1200 ui_out_text (uiout, "Value returned is ");
1201 ui_out_field_fmt (uiout, "gdb-result-var", "$%d",
1202 record_latest_value (value));
1203 ui_out_text (uiout, " = ");
1204 value_print (value, stb->stream, 0, Val_no_prettyprint);
1205 ui_out_field_stream (uiout, "return-value", stb);
1206 ui_out_text (uiout, "\n");
1207 do_cleanups (old_chain);
1208 }
1209 else
1210 {
1211 ui_out_text (uiout, "Value returned has type: ");
1212 ui_out_field_string (uiout, "return-type", TYPE_NAME (value_type));
1213 ui_out_text (uiout, ".");
1214 ui_out_text (uiout, " Cannot determine contents\n");
1215 }
1216 }
1217
1218 /* Stuff that needs to be done by the finish command after the target
1219 has stopped. In asynchronous mode, we wait for the target to stop
1220 in the call to poll or select in the event loop, so it is
1221 impossible to do all the stuff as part of the finish_command
1222 function itself. The only chance we have to complete this command
1223 is in fetch_inferior_event, which is called by the event loop as
1224 soon as it detects that the target has stopped. This function is
1225 called via the cmd_continuation pointer. */
1226
1227 static void
1228 finish_command_continuation (struct continuation_arg *arg)
1229 {
1230 struct symbol *function;
1231 struct breakpoint *breakpoint;
1232 struct cleanup *cleanups;
1233
1234 breakpoint = (struct breakpoint *) arg->data.pointer;
1235 function = (struct symbol *) arg->next->data.pointer;
1236 cleanups = (struct cleanup *) arg->next->next->data.pointer;
1237
1238 if (bpstat_find_breakpoint (stop_bpstat, breakpoint) != NULL
1239 && function != NULL)
1240 {
1241 struct type *value_type;
1242 int struct_return;
1243 int gcc_compiled;
1244
1245 value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function));
1246 if (!value_type)
1247 internal_error (__FILE__, __LINE__,
1248 _("finish_command: function has no target type"));
1249
1250 if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
1251 {
1252 do_exec_cleanups (cleanups);
1253 return;
1254 }
1255
1256 CHECK_TYPEDEF (value_type);
1257 gcc_compiled = BLOCK_GCC_COMPILED (SYMBOL_BLOCK_VALUE (function));
1258 struct_return = using_struct_return (value_type, gcc_compiled);
1259
1260 print_return_value (struct_return, value_type);
1261 }
1262
1263 do_exec_cleanups (cleanups);
1264 }
1265
1266 /* "finish": Set a temporary breakpoint at the place the selected
1267 frame will return to, then continue. */
1268
1269 static void
1270 finish_command (char *arg, int from_tty)
1271 {
1272 struct symtab_and_line sal;
1273 struct frame_info *frame;
1274 struct symbol *function;
1275 struct breakpoint *breakpoint;
1276 struct cleanup *old_chain;
1277 struct continuation_arg *arg1, *arg2, *arg3;
1278
1279 int async_exec = 0;
1280
1281 /* Find out whether we must run in the background. */
1282 if (arg != NULL)
1283 async_exec = strip_bg_char (&arg);
1284
1285 /* If we must run in the background, but the target can't do it,
1286 error out. */
1287 if (async_exec && !target_can_async_p ())
1288 error (_("Asynchronous execution not supported on this target."));
1289
1290 /* If we are not asked to run in the bg, then prepare to run in the
1291 foreground, synchronously. */
1292 if (!async_exec && target_can_async_p ())
1293 {
1294 /* Simulate synchronous execution. */
1295 async_disable_stdin ();
1296 }
1297
1298 if (arg)
1299 error (_("The \"finish\" command does not take any arguments."));
1300 if (!target_has_execution)
1301 error (_("The program is not running."));
1302
1303 frame = get_prev_frame (get_selected_frame (_("No selected frame.")));
1304 if (frame == 0)
1305 error (_("\"finish\" not meaningful in the outermost frame."));
1306
1307 clear_proceed_status ();
1308
1309 sal = find_pc_line (get_frame_pc (frame), 0);
1310 sal.pc = get_frame_pc (frame);
1311
1312 breakpoint = set_momentary_breakpoint (sal, get_frame_id (frame), bp_finish);
1313
1314 if (!target_can_async_p ())
1315 old_chain = make_cleanup_delete_breakpoint (breakpoint);
1316 else
1317 old_chain = make_exec_cleanup_delete_breakpoint (breakpoint);
1318
1319 /* Find the function we will return from. */
1320
1321 function = find_pc_function (get_frame_pc (get_selected_frame (NULL)));
1322
1323 /* Print info on the selected frame, including level number but not
1324 source. */
1325 if (from_tty)
1326 {
1327 printf_filtered (_("Run till exit from "));
1328 print_stack_frame (get_selected_frame (NULL), 1, LOCATION);
1329 }
1330
1331 /* If running asynchronously and the target support asynchronous
1332 execution, set things up for the rest of the finish command to be
1333 completed later on, when gdb has detected that the target has
1334 stopped, in fetch_inferior_event. */
1335 if (target_can_async_p ())
1336 {
1337 arg1 =
1338 (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
1339 arg2 =
1340 (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
1341 arg3 =
1342 (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
1343 arg1->next = arg2;
1344 arg2->next = arg3;
1345 arg3->next = NULL;
1346 arg1->data.pointer = breakpoint;
1347 arg2->data.pointer = function;
1348 arg3->data.pointer = old_chain;
1349 add_continuation (finish_command_continuation, arg1);
1350 }
1351
1352 proceed_to_finish = 1; /* We want stop_registers, please... */
1353 proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
1354
1355 /* Do this only if not running asynchronously or if the target
1356 cannot do async execution. Otherwise, complete this command when
1357 the target actually stops, in fetch_inferior_event. */
1358 if (!target_can_async_p ())
1359 {
1360 /* Did we stop at our breakpoint? */
1361 if (bpstat_find_breakpoint (stop_bpstat, breakpoint) != NULL
1362 && function != NULL)
1363 {
1364 struct type *value_type;
1365 int struct_return;
1366 int gcc_compiled;
1367
1368 value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function));
1369 if (!value_type)
1370 internal_error (__FILE__, __LINE__,
1371 _("finish_command: function has no target type"));
1372
1373 /* FIXME: Shouldn't we do the cleanups before returning? */
1374 if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
1375 return;
1376
1377 CHECK_TYPEDEF (value_type);
1378 gcc_compiled = BLOCK_GCC_COMPILED (SYMBOL_BLOCK_VALUE (function));
1379 struct_return = using_struct_return (value_type, gcc_compiled);
1380
1381 print_return_value (struct_return, value_type);
1382 }
1383
1384 do_cleanups (old_chain);
1385 }
1386 }
1387 \f
1388
1389 static void
1390 program_info (char *args, int from_tty)
1391 {
1392 bpstat bs = stop_bpstat;
1393 int num;
1394 int stat = bpstat_num (&bs, &num);
1395
1396 if (!target_has_execution)
1397 {
1398 printf_filtered (_("The program being debugged is not being run.\n"));
1399 return;
1400 }
1401
1402 target_files_info ();
1403 printf_filtered (_("Program stopped at %s.\n"),
1404 hex_string ((unsigned long) stop_pc));
1405 if (stop_step)
1406 printf_filtered (_("It stopped after being stepped.\n"));
1407 else if (stat != 0)
1408 {
1409 /* There may be several breakpoints in the same place, so this
1410 isn't as strange as it seems. */
1411 while (stat != 0)
1412 {
1413 if (stat < 0)
1414 {
1415 printf_filtered (_("\
1416 It stopped at a breakpoint that has since been deleted.\n"));
1417 }
1418 else
1419 printf_filtered (_("It stopped at breakpoint %d.\n"), num);
1420 stat = bpstat_num (&bs, &num);
1421 }
1422 }
1423 else if (stop_signal != TARGET_SIGNAL_0)
1424 {
1425 printf_filtered (_("It stopped with signal %s, %s.\n"),
1426 target_signal_to_name (stop_signal),
1427 target_signal_to_string (stop_signal));
1428 }
1429
1430 if (!from_tty)
1431 {
1432 printf_filtered (_("\
1433 Type \"info stack\" or \"info registers\" for more information.\n"));
1434 }
1435 }
1436 \f
1437 static void
1438 environment_info (char *var, int from_tty)
1439 {
1440 if (var)
1441 {
1442 char *val = get_in_environ (inferior_environ, var);
1443 if (val)
1444 {
1445 puts_filtered (var);
1446 puts_filtered (" = ");
1447 puts_filtered (val);
1448 puts_filtered ("\n");
1449 }
1450 else
1451 {
1452 puts_filtered ("Environment variable \"");
1453 puts_filtered (var);
1454 puts_filtered ("\" not defined.\n");
1455 }
1456 }
1457 else
1458 {
1459 char **vector = environ_vector (inferior_environ);
1460 while (*vector)
1461 {
1462 puts_filtered (*vector++);
1463 puts_filtered ("\n");
1464 }
1465 }
1466 }
1467
1468 static void
1469 set_environment_command (char *arg, int from_tty)
1470 {
1471 char *p, *val, *var;
1472 int nullset = 0;
1473
1474 if (arg == 0)
1475 error_no_arg (_("environment variable and value"));
1476
1477 /* Find seperation between variable name and value */
1478 p = (char *) strchr (arg, '=');
1479 val = (char *) strchr (arg, ' ');
1480
1481 if (p != 0 && val != 0)
1482 {
1483 /* We have both a space and an equals. If the space is before the
1484 equals, walk forward over the spaces til we see a nonspace
1485 (possibly the equals). */
1486 if (p > val)
1487 while (*val == ' ')
1488 val++;
1489
1490 /* Now if the = is after the char following the spaces,
1491 take the char following the spaces. */
1492 if (p > val)
1493 p = val - 1;
1494 }
1495 else if (val != 0 && p == 0)
1496 p = val;
1497
1498 if (p == arg)
1499 error_no_arg (_("environment variable to set"));
1500
1501 if (p == 0 || p[1] == 0)
1502 {
1503 nullset = 1;
1504 if (p == 0)
1505 p = arg + strlen (arg); /* So that savestring below will work */
1506 }
1507 else
1508 {
1509 /* Not setting variable value to null */
1510 val = p + 1;
1511 while (*val == ' ' || *val == '\t')
1512 val++;
1513 }
1514
1515 while (p != arg && (p[-1] == ' ' || p[-1] == '\t'))
1516 p--;
1517
1518 var = savestring (arg, p - arg);
1519 if (nullset)
1520 {
1521 printf_filtered (_("\
1522 Setting environment variable \"%s\" to null value.\n"),
1523 var);
1524 set_in_environ (inferior_environ, var, "");
1525 }
1526 else
1527 set_in_environ (inferior_environ, var, val);
1528 xfree (var);
1529 }
1530
1531 static void
1532 unset_environment_command (char *var, int from_tty)
1533 {
1534 if (var == 0)
1535 {
1536 /* If there is no argument, delete all environment variables.
1537 Ask for confirmation if reading from the terminal. */
1538 if (!from_tty || query (_("Delete all environment variables? ")))
1539 {
1540 free_environ (inferior_environ);
1541 inferior_environ = make_environ ();
1542 }
1543 }
1544 else
1545 unset_in_environ (inferior_environ, var);
1546 }
1547
1548 /* Handle the execution path (PATH variable) */
1549
1550 static const char path_var_name[] = "PATH";
1551
1552 static void
1553 path_info (char *args, int from_tty)
1554 {
1555 puts_filtered ("Executable and object file path: ");
1556 puts_filtered (get_in_environ (inferior_environ, path_var_name));
1557 puts_filtered ("\n");
1558 }
1559
1560 /* Add zero or more directories to the front of the execution path. */
1561
1562 static void
1563 path_command (char *dirname, int from_tty)
1564 {
1565 char *exec_path;
1566 char *env;
1567 dont_repeat ();
1568 env = get_in_environ (inferior_environ, path_var_name);
1569 /* Can be null if path is not set */
1570 if (!env)
1571 env = "";
1572 exec_path = xstrdup (env);
1573 mod_path (dirname, &exec_path);
1574 set_in_environ (inferior_environ, path_var_name, exec_path);
1575 xfree (exec_path);
1576 if (from_tty)
1577 path_info ((char *) NULL, from_tty);
1578 }
1579 \f
1580
1581 /* Print out the machine register regnum. If regnum is -1, print all
1582 registers (print_all == 1) or all non-float and non-vector
1583 registers (print_all == 0).
1584
1585 For most machines, having all_registers_info() print the
1586 register(s) one per line is good enough. If a different format is
1587 required, (eg, for MIPS or Pyramid 90x, which both have lots of
1588 regs), or there is an existing convention for showing all the
1589 registers, define the architecture method PRINT_REGISTERS_INFO to
1590 provide that format. */
1591
1592 void
1593 default_print_registers_info (struct gdbarch *gdbarch,
1594 struct ui_file *file,
1595 struct frame_info *frame,
1596 int regnum, int print_all)
1597 {
1598 int i;
1599 const int numregs = NUM_REGS + NUM_PSEUDO_REGS;
1600 gdb_byte buffer[MAX_REGISTER_SIZE];
1601
1602 for (i = 0; i < numregs; i++)
1603 {
1604 /* Decide between printing all regs, non-float / vector regs, or
1605 specific reg. */
1606 if (regnum == -1)
1607 {
1608 if (print_all)
1609 {
1610 if (!gdbarch_register_reggroup_p (gdbarch, i, all_reggroup))
1611 continue;
1612 }
1613 else
1614 {
1615 if (!gdbarch_register_reggroup_p (gdbarch, i, general_reggroup))
1616 continue;
1617 }
1618 }
1619 else
1620 {
1621 if (i != regnum)
1622 continue;
1623 }
1624
1625 /* If the register name is empty, it is undefined for this
1626 processor, so don't display anything. */
1627 if (REGISTER_NAME (i) == NULL || *(REGISTER_NAME (i)) == '\0')
1628 continue;
1629
1630 fputs_filtered (REGISTER_NAME (i), file);
1631 print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), file);
1632
1633 /* Get the data in raw format. */
1634 if (! frame_register_read (frame, i, buffer))
1635 {
1636 fprintf_filtered (file, "*value not available*\n");
1637 continue;
1638 }
1639
1640 /* If virtual format is floating, print it that way, and in raw
1641 hex. */
1642 if (TYPE_CODE (register_type (current_gdbarch, i)) == TYPE_CODE_FLT)
1643 {
1644 int j;
1645
1646 val_print (register_type (current_gdbarch, i), buffer, 0, 0,
1647 file, 0, 1, 0, Val_pretty_default);
1648
1649 fprintf_filtered (file, "\t(raw 0x");
1650 for (j = 0; j < register_size (current_gdbarch, i); j++)
1651 {
1652 int idx;
1653 if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
1654 idx = j;
1655 else
1656 idx = register_size (current_gdbarch, i) - 1 - j;
1657 fprintf_filtered (file, "%02x", (unsigned char) buffer[idx]);
1658 }
1659 fprintf_filtered (file, ")");
1660 }
1661 else
1662 {
1663 /* Print the register in hex. */
1664 val_print (register_type (current_gdbarch, i), buffer, 0, 0,
1665 file, 'x', 1, 0, Val_pretty_default);
1666 /* If not a vector register, print it also according to its
1667 natural format. */
1668 if (TYPE_VECTOR (register_type (current_gdbarch, i)) == 0)
1669 {
1670 fprintf_filtered (file, "\t");
1671 val_print (register_type (current_gdbarch, i), buffer, 0, 0,
1672 file, 0, 1, 0, Val_pretty_default);
1673 }
1674 }
1675
1676 fprintf_filtered (file, "\n");
1677 }
1678 }
1679
1680 void
1681 registers_info (char *addr_exp, int fpregs)
1682 {
1683 struct frame_info *frame;
1684 int regnum, numregs;
1685 char *end;
1686
1687 if (!target_has_registers)
1688 error (_("The program has no registers now."));
1689 frame = get_selected_frame (NULL);
1690
1691 if (!addr_exp)
1692 {
1693 gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
1694 frame, -1, fpregs);
1695 return;
1696 }
1697
1698 while (*addr_exp != '\0')
1699 {
1700 char *start;
1701 const char *end;
1702
1703 /* Keep skipping leading white space. */
1704 if (isspace ((*addr_exp)))
1705 {
1706 addr_exp++;
1707 continue;
1708 }
1709
1710 /* Discard any leading ``$''. Check that there is something
1711 resembling a register following it. */
1712 if (addr_exp[0] == '$')
1713 addr_exp++;
1714 if (isspace ((*addr_exp)) || (*addr_exp) == '\0')
1715 error (_("Missing register name"));
1716
1717 /* Find the start/end of this register name/num/group. */
1718 start = addr_exp;
1719 while ((*addr_exp) != '\0' && !isspace ((*addr_exp)))
1720 addr_exp++;
1721 end = addr_exp;
1722
1723 /* Figure out what we've found and display it. */
1724
1725 /* A register name? */
1726 {
1727 int regnum = frame_map_name_to_regnum (frame,
1728 start, end - start);
1729 if (regnum >= 0)
1730 {
1731 gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
1732 frame, regnum, fpregs);
1733 continue;
1734 }
1735 }
1736
1737 /* A register number? (how portable is this one?). */
1738 {
1739 char *endptr;
1740 int regnum = strtol (start, &endptr, 0);
1741 if (endptr == end
1742 && regnum >= 0
1743 && regnum < NUM_REGS + NUM_PSEUDO_REGS)
1744 {
1745 gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
1746 frame, regnum, fpregs);
1747 continue;
1748 }
1749 }
1750
1751 /* A register group? */
1752 {
1753 struct reggroup *group;
1754 for (group = reggroup_next (current_gdbarch, NULL);
1755 group != NULL;
1756 group = reggroup_next (current_gdbarch, group))
1757 {
1758 /* Don't bother with a length check. Should the user
1759 enter a short register group name, go with the first
1760 group that matches. */
1761 if (strncmp (start, reggroup_name (group), end - start) == 0)
1762 break;
1763 }
1764 if (group != NULL)
1765 {
1766 int regnum;
1767 for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
1768 {
1769 if (gdbarch_register_reggroup_p (current_gdbarch, regnum,
1770 group))
1771 gdbarch_print_registers_info (current_gdbarch,
1772 gdb_stdout, frame,
1773 regnum, fpregs);
1774 }
1775 continue;
1776 }
1777 }
1778
1779 /* Nothing matched. */
1780 error (_("Invalid register `%.*s'"), (int) (end - start), start);
1781 }
1782 }
1783
1784 void
1785 all_registers_info (char *addr_exp, int from_tty)
1786 {
1787 registers_info (addr_exp, 1);
1788 }
1789
1790 static void
1791 nofp_registers_info (char *addr_exp, int from_tty)
1792 {
1793 registers_info (addr_exp, 0);
1794 }
1795
1796 static void
1797 print_vector_info (struct gdbarch *gdbarch, struct ui_file *file,
1798 struct frame_info *frame, const char *args)
1799 {
1800 if (gdbarch_print_vector_info_p (gdbarch))
1801 gdbarch_print_vector_info (gdbarch, file, frame, args);
1802 else
1803 {
1804 int regnum;
1805 int printed_something = 0;
1806
1807 for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
1808 {
1809 if (gdbarch_register_reggroup_p (gdbarch, regnum, vector_reggroup))
1810 {
1811 printed_something = 1;
1812 gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1);
1813 }
1814 }
1815 if (!printed_something)
1816 fprintf_filtered (file, "No vector information\n");
1817 }
1818 }
1819
1820 static void
1821 vector_info (char *args, int from_tty)
1822 {
1823 if (!target_has_registers)
1824 error (_("The program has no registers now."));
1825
1826 print_vector_info (current_gdbarch, gdb_stdout,
1827 get_selected_frame (NULL), args);
1828 }
1829 \f
1830
1831 /*
1832 * TODO:
1833 * Should save/restore the tty state since it might be that the
1834 * program to be debugged was started on this tty and it wants
1835 * the tty in some state other than what we want. If it's running
1836 * on another terminal or without a terminal, then saving and
1837 * restoring the tty state is a harmless no-op.
1838 * This only needs to be done if we are attaching to a process.
1839 */
1840
1841 /*
1842 attach_command --
1843 takes a program started up outside of gdb and ``attaches'' to it.
1844 This stops it cold in its tracks and allows us to start debugging it.
1845 and wait for the trace-trap that results from attaching. */
1846
1847 void
1848 attach_command (char *args, int from_tty)
1849 {
1850 char *exec_file;
1851 char *full_exec_path = NULL;
1852
1853 dont_repeat (); /* Not for the faint of heart */
1854
1855 if (target_has_execution)
1856 {
1857 if (query ("A program is being debugged already. Kill it? "))
1858 target_kill ();
1859 else
1860 error (_("Not killed."));
1861 }
1862
1863 /* Clean up any leftovers from other runs. Some other things from
1864 this function should probably be moved into target_pre_inferior. */
1865 target_pre_inferior (from_tty);
1866
1867 /* Clear out solib state. Otherwise the solib state of the previous
1868 inferior might have survived and is entirely wrong for the new
1869 target. This has been observed on GNU/Linux using glibc 2.3. How
1870 to reproduce:
1871
1872 bash$ ./foo&
1873 [1] 4711
1874 bash$ ./foo&
1875 [1] 4712
1876 bash$ gdb ./foo
1877 [...]
1878 (gdb) attach 4711
1879 (gdb) detach
1880 (gdb) attach 4712
1881 Cannot access memory at address 0xdeadbeef
1882 */
1883 #ifdef CLEAR_SOLIB
1884 CLEAR_SOLIB ();
1885 #else
1886 clear_solib ();
1887 #endif
1888
1889 target_attach (args, from_tty);
1890
1891 /* Set up the "saved terminal modes" of the inferior
1892 based on what modes we are starting it with. */
1893 target_terminal_init ();
1894
1895 /* Set up execution context to know that we should return from
1896 wait_for_inferior as soon as the target reports a stop. */
1897 init_wait_for_inferior ();
1898 clear_proceed_status ();
1899
1900 /* No traps are generated when attaching to inferior under Mach 3
1901 or GNU hurd. */
1902 #ifndef ATTACH_NO_WAIT
1903 /* Careful here. See comments in inferior.h. Basically some OSes
1904 don't ignore SIGSTOPs on continue requests anymore. We need a
1905 way for handle_inferior_event to reset the stop_signal variable
1906 after an attach, and this is what STOP_QUIETLY_NO_SIGSTOP is for. */
1907 stop_soon = STOP_QUIETLY_NO_SIGSTOP;
1908 wait_for_inferior ();
1909 stop_soon = NO_STOP_QUIETLY;
1910 #endif
1911
1912 /*
1913 * If no exec file is yet known, try to determine it from the
1914 * process itself.
1915 */
1916 exec_file = (char *) get_exec_file (0);
1917 if (!exec_file)
1918 {
1919 exec_file = target_pid_to_exec_file (PIDGET (inferior_ptid));
1920 if (exec_file)
1921 {
1922 /* It's possible we don't have a full path, but rather just a
1923 filename. Some targets, such as HP-UX, don't provide the
1924 full path, sigh.
1925
1926 Attempt to qualify the filename against the source path.
1927 (If that fails, we'll just fall back on the original
1928 filename. Not much more we can do...)
1929 */
1930 if (!source_full_path_of (exec_file, &full_exec_path))
1931 full_exec_path = savestring (exec_file, strlen (exec_file));
1932
1933 exec_file_attach (full_exec_path, from_tty);
1934 symbol_file_add_main (full_exec_path, from_tty);
1935 }
1936 }
1937 else
1938 {
1939 reopen_exec_file ();
1940 reread_symbols ();
1941 }
1942
1943 /* Take any necessary post-attaching actions for this platform.
1944 */
1945 target_post_attach (PIDGET (inferior_ptid));
1946
1947 post_create_inferior (&current_target, from_tty);
1948
1949 /* Install inferior's terminal modes. */
1950 target_terminal_inferior ();
1951
1952 normal_stop ();
1953
1954 if (deprecated_attach_hook)
1955 deprecated_attach_hook ();
1956 }
1957
1958 /*
1959 * detach_command --
1960 * takes a program previously attached to and detaches it.
1961 * The program resumes execution and will no longer stop
1962 * on signals, etc. We better not have left any breakpoints
1963 * in the program or it'll die when it hits one. For this
1964 * to work, it may be necessary for the process to have been
1965 * previously attached. It *might* work if the program was
1966 * started via the normal ptrace (PTRACE_TRACEME).
1967 */
1968
1969 static void
1970 detach_command (char *args, int from_tty)
1971 {
1972 dont_repeat (); /* Not for the faint of heart. */
1973 target_detach (args, from_tty);
1974 #if defined(SOLIB_RESTART)
1975 SOLIB_RESTART ();
1976 #endif
1977 if (deprecated_detach_hook)
1978 deprecated_detach_hook ();
1979 }
1980
1981 /* Disconnect from the current target without resuming it (leaving it
1982 waiting for a debugger).
1983
1984 We'd better not have left any breakpoints in the program or the
1985 next debugger will get confused. Currently only supported for some
1986 remote targets, since the normal attach mechanisms don't work on
1987 stopped processes on some native platforms (e.g. GNU/Linux). */
1988
1989 static void
1990 disconnect_command (char *args, int from_tty)
1991 {
1992 dont_repeat (); /* Not for the faint of heart */
1993 target_disconnect (args, from_tty);
1994 #if defined(SOLIB_RESTART)
1995 SOLIB_RESTART ();
1996 #endif
1997 if (deprecated_detach_hook)
1998 deprecated_detach_hook ();
1999 }
2000
2001 /* Stop the execution of the target while running in async mode, in
2002 the backgound. */
2003 void
2004 interrupt_target_command (char *args, int from_tty)
2005 {
2006 if (target_can_async_p ())
2007 {
2008 dont_repeat (); /* Not for the faint of heart */
2009 target_stop ();
2010 }
2011 }
2012
2013 static void
2014 print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
2015 struct frame_info *frame, const char *args)
2016 {
2017 if (gdbarch_print_float_info_p (gdbarch))
2018 gdbarch_print_float_info (gdbarch, file, frame, args);
2019 else
2020 {
2021 int regnum;
2022 int printed_something = 0;
2023
2024 for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
2025 {
2026 if (gdbarch_register_reggroup_p (gdbarch, regnum, float_reggroup))
2027 {
2028 printed_something = 1;
2029 gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1);
2030 }
2031 }
2032 if (!printed_something)
2033 fprintf_filtered (file, "\
2034 No floating-point info available for this processor.\n");
2035 }
2036 }
2037
2038 static void
2039 float_info (char *args, int from_tty)
2040 {
2041 if (!target_has_registers)
2042 error (_("The program has no registers now."));
2043
2044 print_float_info (current_gdbarch, gdb_stdout,
2045 get_selected_frame (NULL), args);
2046 }
2047 \f
2048 static void
2049 unset_command (char *args, int from_tty)
2050 {
2051 printf_filtered (_("\
2052 \"unset\" must be followed by the name of an unset subcommand.\n"));
2053 help_list (unsetlist, "unset ", -1, gdb_stdout);
2054 }
2055
2056 void
2057 _initialize_infcmd (void)
2058 {
2059 struct cmd_list_element *c = NULL;
2060
2061 /* add the filename of the terminal connected to inferior I/O */
2062 add_setshow_filename_cmd ("inferior-tty", class_run,
2063 &inferior_io_terminal, _("\
2064 Set terminal for future runs of program being debugged."), _("\
2065 Show terminal for future runs of program being debugged."), _("\
2066 Usage: set inferior-tty /dev/pts/1"), NULL, NULL, &setlist, &showlist);
2067 add_com_alias ("tty", "set inferior-tty", class_alias, 0);
2068
2069 add_setshow_optional_filename_cmd ("args", class_run,
2070 &inferior_args, _("\
2071 Set argument list to give program being debugged when it is started."), _("\
2072 Show argument list to give program being debugged when it is started."), _("\
2073 Follow this command with any number of args, to be passed to the program."),
2074 notice_args_set,
2075 notice_args_read,
2076 &setlist, &showlist);
2077
2078 c = add_cmd ("environment", no_class, environment_info, _("\
2079 The environment to give the program, or one variable's value.\n\
2080 With an argument VAR, prints the value of environment variable VAR to\n\
2081 give the program being debugged. With no arguments, prints the entire\n\
2082 environment to be given to the program."), &showlist);
2083 set_cmd_completer (c, noop_completer);
2084
2085 add_prefix_cmd ("unset", no_class, unset_command,
2086 _("Complement to certain \"set\" commands."),
2087 &unsetlist, "unset ", 0, &cmdlist);
2088
2089 c = add_cmd ("environment", class_run, unset_environment_command, _("\
2090 Cancel environment variable VAR for the program.\n\
2091 This does not affect the program until the next \"run\" command."),
2092 &unsetlist);
2093 set_cmd_completer (c, noop_completer);
2094
2095 c = add_cmd ("environment", class_run, set_environment_command, _("\
2096 Set environment variable value to give the program.\n\
2097 Arguments are VAR VALUE where VAR is variable name and VALUE is value.\n\
2098 VALUES of environment variables are uninterpreted strings.\n\
2099 This does not affect the program until the next \"run\" command."),
2100 &setlist);
2101 set_cmd_completer (c, noop_completer);
2102
2103 c = add_com ("path", class_files, path_command, _("\
2104 Add directory DIR(s) to beginning of search path for object files.\n\
2105 $cwd in the path means the current working directory.\n\
2106 This path is equivalent to the $PATH shell variable. It is a list of\n\
2107 directories, separated by colons. These directories are searched to find\n\
2108 fully linked executable files and separately compiled object files as needed."));
2109 set_cmd_completer (c, filename_completer);
2110
2111 c = add_cmd ("paths", no_class, path_info, _("\
2112 Current search path for finding object files.\n\
2113 $cwd in the path means the current working directory.\n\
2114 This path is equivalent to the $PATH shell variable. It is a list of\n\
2115 directories, separated by colons. These directories are searched to find\n\
2116 fully linked executable files and separately compiled object files as needed."),
2117 &showlist);
2118 set_cmd_completer (c, noop_completer);
2119
2120 add_com ("attach", class_run, attach_command, _("\
2121 Attach to a process or file outside of GDB.\n\
2122 This command attaches to another target, of the same type as your last\n\
2123 \"target\" command (\"info files\" will show your target stack).\n\
2124 The command may take as argument a process id or a device file.\n\
2125 For a process id, you must have permission to send the process a signal,\n\
2126 and it must have the same effective uid as the debugger.\n\
2127 When using \"attach\" with a process id, the debugger finds the\n\
2128 program running in the process, looking first in the current working\n\
2129 directory, or (if not found there) using the source file search path\n\
2130 (see the \"directory\" command). You can also use the \"file\" command\n\
2131 to specify the program, and to load its symbol table."));
2132
2133 add_prefix_cmd ("detach", class_run, detach_command, _("\
2134 Detach a process or file previously attached.\n\
2135 If a process, it is no longer traced, and it continues its execution. If\n\
2136 you were debugging a file, the file is closed and gdb no longer accesses it."),
2137 &detachlist, "detach ", 0, &cmdlist);
2138
2139 add_com ("disconnect", class_run, disconnect_command, _("\
2140 Disconnect from a target.\n\
2141 The target will wait for another debugger to connect. Not available for\n\
2142 all targets."));
2143
2144 add_com ("signal", class_run, signal_command, _("\
2145 Continue program giving it signal specified by the argument.\n\
2146 An argument of \"0\" means continue program without giving it a signal."));
2147
2148 add_com ("stepi", class_run, stepi_command, _("\
2149 Step one instruction exactly.\n\
2150 Argument N means do this N times (or till program stops for another reason)."));
2151 add_com_alias ("si", "stepi", class_alias, 0);
2152
2153 add_com ("nexti", class_run, nexti_command, _("\
2154 Step one instruction, but proceed through subroutine calls.\n\
2155 Argument N means do this N times (or till program stops for another reason)."));
2156 add_com_alias ("ni", "nexti", class_alias, 0);
2157
2158 add_com ("finish", class_run, finish_command, _("\
2159 Execute until selected stack frame returns.\n\
2160 Upon return, the value returned is printed and put in the value history."));
2161
2162 add_com ("next", class_run, next_command, _("\
2163 Step program, proceeding through subroutine calls.\n\
2164 Like the \"step\" command as long as subroutine calls do not happen;\n\
2165 when they do, the call is treated as one instruction.\n\
2166 Argument N means do this N times (or till program stops for another reason)."));
2167 add_com_alias ("n", "next", class_run, 1);
2168 if (xdb_commands)
2169 add_com_alias ("S", "next", class_run, 1);
2170
2171 add_com ("step", class_run, step_command, _("\
2172 Step program until it reaches a different source line.\n\
2173 Argument N means do this N times (or till program stops for another reason)."));
2174 add_com_alias ("s", "step", class_run, 1);
2175
2176 c = add_com ("until", class_run, until_command, _("\
2177 Execute until the program reaches a source line greater than the current\n\
2178 or a specified location (same args as break command) within the current frame."));
2179 set_cmd_completer (c, location_completer);
2180 add_com_alias ("u", "until", class_run, 1);
2181
2182 c = add_com ("advance", class_run, advance_command, _("\
2183 Continue the program up to the given location (same form as args for break command).\n\
2184 Execution will also stop upon exit from the current stack frame."));
2185 set_cmd_completer (c, location_completer);
2186
2187 c = add_com ("jump", class_run, jump_command, _("\
2188 Continue program being debugged at specified line or address.\n\
2189 Give as argument either LINENUM or *ADDR, where ADDR is an expression\n\
2190 for an address to start at."));
2191 set_cmd_completer (c, location_completer);
2192
2193 if (xdb_commands)
2194 {
2195 c = add_com ("go", class_run, go_command, _("\
2196 Usage: go <location>\n\
2197 Continue program being debugged, stopping at specified line or \n\
2198 address.\n\
2199 Give as argument either LINENUM or *ADDR, where ADDR is an \n\
2200 expression for an address to start at.\n\
2201 This command is a combination of tbreak and jump."));
2202 set_cmd_completer (c, location_completer);
2203 }
2204
2205 if (xdb_commands)
2206 add_com_alias ("g", "go", class_run, 1);
2207
2208 add_com ("continue", class_run, continue_command, _("\
2209 Continue program being debugged, after signal or breakpoint.\n\
2210 If proceeding from breakpoint, a number N may be used as an argument,\n\
2211 which means to set the ignore count of that breakpoint to N - 1 (so that\n\
2212 the breakpoint won't break until the Nth time it is reached)."));
2213 add_com_alias ("c", "cont", class_run, 1);
2214 add_com_alias ("fg", "cont", class_run, 1);
2215
2216 c = add_com ("run", class_run, run_command, _("\
2217 Start debugged program. You may specify arguments to give it.\n\
2218 Args may include \"*\", or \"[...]\"; they are expanded using \"sh\".\n\
2219 Input and output redirection with \">\", \"<\", or \">>\" are also allowed.\n\n\
2220 With no arguments, uses arguments last specified (with \"run\" or \"set args\").\n\
2221 To cancel previous arguments and run with no arguments,\n\
2222 use \"set args\" without arguments."));
2223 set_cmd_completer (c, filename_completer);
2224 add_com_alias ("r", "run", class_run, 1);
2225 if (xdb_commands)
2226 add_com ("R", class_run, run_no_args_command,
2227 _("Start debugged program with no arguments."));
2228
2229 c = add_com ("start", class_run, start_command, _("\
2230 Run the debugged program until the beginning of the main procedure.\n\
2231 You may specify arguments to give to your program, just as with the\n\
2232 \"run\" command."));
2233 set_cmd_completer (c, filename_completer);
2234
2235 add_com ("interrupt", class_run, interrupt_target_command,
2236 _("Interrupt the execution of the debugged program."));
2237
2238 add_info ("registers", nofp_registers_info, _("\
2239 List of integer registers and their contents, for selected stack frame.\n\
2240 Register name as argument means describe only that register."));
2241 add_info_alias ("r", "registers", 1);
2242
2243 if (xdb_commands)
2244 add_com ("lr", class_info, nofp_registers_info, _("\
2245 List of integer registers and their contents, for selected stack frame.\n\
2246 Register name as argument means describe only that register."));
2247 add_info ("all-registers", all_registers_info, _("\
2248 List of all registers and their contents, for selected stack frame.\n\
2249 Register name as argument means describe only that register."));
2250
2251 add_info ("program", program_info,
2252 _("Execution status of the program."));
2253
2254 add_info ("float", float_info,
2255 _("Print the status of the floating point unit\n"));
2256
2257 add_info ("vector", vector_info,
2258 _("Print the status of the vector unit\n"));
2259
2260 inferior_environ = make_environ ();
2261 init_environ (inferior_environ);
2262 }
This page took 0.187711 seconds and 4 git commands to generate.