frame: add frame_id_build_unavailable_stack_special
[deliverable/binutils-gdb.git] / gdb / record.c
CommitLineData
69d05d38
HZ
1/* Process record and replay target for GDB, the GNU debugger.
2
ecd75fc8 3 Copyright (C) 2008-2014 Free Software Foundation, Inc.
69d05d38
HZ
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20#include "defs.h"
21#include "gdbcmd.h"
0156b218 22#include "completer.h"
69d05d38 23#include "record.h"
82a90ccf 24#include "observer.h"
d02ed0bb
MM
25#include "inferior.h"
26#include "common/common-utils.h"
67c86d06
MM
27#include "cli/cli-utils.h"
28#include "disasm.h"
29
30#include <ctype.h>
69d05d38 31
d02ed0bb
MM
32/* This is the debug switch for process record. */
33unsigned int record_debug = 0;
27699eea 34
67c86d06
MM
35/* The number of instructions to print in "record instruction-history". */
36static unsigned int record_insn_history_size = 10;
37
42c634cb
PA
38/* The variable registered as control variable in the "record
39 instruction-history" command. Necessary for extra input
40 validation. */
41static unsigned int record_insn_history_size_setshow_var;
42
15984c13
MM
43/* The number of functions to print in "record function-call-history". */
44static unsigned int record_call_history_size = 10;
45
42c634cb
PA
46/* The variable registered as control variable in the "record
47 call-history" command. Necessary for extra input validation. */
48static unsigned int record_call_history_size_setshow_var;
49
d02ed0bb 50struct cmd_list_element *record_cmdlist = NULL;
742ce053 51struct cmd_list_element *record_goto_cmdlist = NULL;
d02ed0bb
MM
52struct cmd_list_element *set_record_cmdlist = NULL;
53struct cmd_list_element *show_record_cmdlist = NULL;
54struct cmd_list_element *info_record_cmdlist = NULL;
27699eea 55
7c1687a9
MM
56#define DEBUG(msg, args...) \
57 if (record_debug) \
58 fprintf_unfiltered (gdb_stdlog, "record: " msg "\n", ##args)
59
8213266a 60/* See record.h. */
27699eea 61
8213266a 62struct target_ops *
d02ed0bb 63find_record_target (void)
27699eea 64{
d02ed0bb 65 struct target_ops *t;
123f5f96 66
d02ed0bb
MM
67 for (t = current_target.beneath; t != NULL; t = t->beneath)
68 if (t->to_stratum == record_stratum)
69 return t;
27699eea 70
d02ed0bb 71 return NULL;
27699eea
MS
72}
73
d02ed0bb 74/* Check that recording is active. Throw an error, if it isn't. */
27699eea 75
d02ed0bb
MM
76static struct target_ops *
77require_record_target (void)
27699eea 78{
d02ed0bb 79 struct target_ops *t;
27699eea 80
d02ed0bb
MM
81 t = find_record_target ();
82 if (t == NULL)
83 error (_("No record target is currently active.\n"
84 "Use one of the \"target record-<tab><tab>\" commands first."));
27699eea 85
d02ed0bb 86 return t;
27699eea
MS
87}
88
d02ed0bb 89/* See record.h. */
27699eea 90
8213266a
PA
91void
92record_preopen (void)
93{
94 /* Check if a record target is already running. */
95 if (find_record_target () != NULL)
96 error (_("The process is already being recorded. Use \"record stop\" to "
97 "stop recording first."));
98}
99
100/* See record.h. */
101
d02ed0bb
MM
102int
103record_read_memory (struct gdbarch *gdbarch,
104 CORE_ADDR memaddr, gdb_byte *myaddr,
105 ssize_t len)
27699eea 106{
d02ed0bb 107 int ret = target_read_memory (memaddr, myaddr, len);
27699eea 108
7c1687a9
MM
109 if (ret != 0)
110 DEBUG ("error reading memory at addr %s len = %ld.\n",
111 paddress (gdbarch, memaddr), (long) len);
112
d02ed0bb 113 return ret;
27699eea
MS
114}
115
7c1687a9
MM
116/* Stop recording. */
117
118static void
119record_stop (struct target_ops *t)
120{
121 DEBUG ("stop %s", t->to_shortname);
122
123 if (t->to_stop_recording != NULL)
124 t->to_stop_recording ();
125}
126
127/* Unpush the record target. */
128
129static void
130record_unpush (struct target_ops *t)
131{
132 DEBUG ("unpush %s", t->to_shortname);
133
134 unpush_target (t);
135}
136
137/* See record.h. */
138
139void
140record_disconnect (struct target_ops *t, char *args, int from_tty)
141{
142 gdb_assert (t->to_stratum == record_stratum);
143
144 DEBUG ("disconnect %s", t->to_shortname);
145
146 record_stop (t);
147 record_unpush (t);
148
149 target_disconnect (args, from_tty);
150}
151
152/* See record.h. */
153
154void
52554a0e 155record_detach (struct target_ops *t, const char *args, int from_tty)
7c1687a9
MM
156{
157 gdb_assert (t->to_stratum == record_stratum);
158
159 DEBUG ("detach %s", t->to_shortname);
160
161 record_stop (t);
162 record_unpush (t);
163
164 target_detach (args, from_tty);
165}
166
167/* See record.h. */
168
169void
170record_mourn_inferior (struct target_ops *t)
171{
172 gdb_assert (t->to_stratum == record_stratum);
173
174 DEBUG ("mourn inferior %s", t->to_shortname);
175
176 /* It is safer to not stop recording. Resources will be freed when
177 threads are discarded. */
178 record_unpush (t);
179
180 target_mourn_inferior ();
181}
182
183/* See record.h. */
184
185void
186record_kill (struct target_ops *t)
187{
188 gdb_assert (t->to_stratum == record_stratum);
189
190 DEBUG ("kill %s", t->to_shortname);
191
192 /* It is safer to not stop recording. Resources will be freed when
193 threads are discarded. */
194 record_unpush (t);
195
196 target_kill ();
197}
198
6df67667
MS
199/* Implement "show record debug" command. */
200
69d05d38
HZ
201static void
202show_record_debug (struct ui_file *file, int from_tty,
203 struct cmd_list_element *c, const char *value)
204{
205 fprintf_filtered (file, _("Debugging of process record target is %s.\n"),
206 value);
207}
208
209/* Alias for "target record". */
210
211static void
212cmd_record_start (char *args, int from_tty)
213{
d02ed0bb 214 execute_command ("target record-full", from_tty);
69d05d38
HZ
215}
216
217/* Truncate the record log from the present point
218 of replay until the end. */
219
220static void
221cmd_record_delete (char *args, int from_tty)
222{
d02ed0bb
MM
223 require_record_target ();
224
225 if (!target_record_is_replaying ())
69d05d38 226 {
d02ed0bb
MM
227 printf_unfiltered (_("Already at end of record list.\n"));
228 return;
229 }
69d05d38 230
d02ed0bb
MM
231 if (!target_supports_delete_record ())
232 {
233 printf_unfiltered (_("The current record target does not support "
234 "this operation.\n"));
235 return;
69d05d38 236 }
d02ed0bb
MM
237
238 if (!from_tty || query (_("Delete the log from this point forward "
239 "and begin to record the running message "
240 "at current PC?")))
241 target_delete_record ();
69d05d38
HZ
242}
243
6df67667 244/* Implement the "stoprecord" or "record stop" command. */
69d05d38
HZ
245
246static void
247cmd_record_stop (char *args, int from_tty)
248{
d02ed0bb 249 struct target_ops *t;
82a90ccf 250
d02ed0bb 251 t = require_record_target ();
7c1687a9
MM
252
253 record_stop (t);
254 record_unpush (t);
69d05d38 255
d02ed0bb
MM
256 printf_unfiltered (_("Process record is stopped and all execution "
257 "logs are deleted.\n"));
69d05d38 258
d02ed0bb 259 observer_notify_record_changed (current_inferior (), 0);
69d05d38
HZ
260}
261
d02ed0bb 262/* The "set record" command. */
69d05d38
HZ
263
264static void
265set_record_command (char *args, int from_tty)
266{
3e43a32a
MS
267 printf_unfiltered (_("\"set record\" must be followed "
268 "by an apporpriate subcommand.\n"));
69d05d38
HZ
269 help_list (set_record_cmdlist, "set record ", all_commands, gdb_stdout);
270}
271
d02ed0bb
MM
272/* The "show record" command. */
273
69d05d38
HZ
274static void
275show_record_command (char *args, int from_tty)
276{
277 cmd_show_list (show_record_cmdlist, from_tty, "");
278}
279
d02ed0bb 280/* The "info record" command. */
b54295a7 281
69d05d38
HZ
282static void
283info_record_command (char *args, int from_tty)
284{
d02ed0bb 285 struct target_ops *t;
0156b218 286
d02ed0bb
MM
287 t = find_record_target ();
288 if (t == NULL)
0156b218 289 {
d02ed0bb
MM
290 printf_filtered (_("No record target is currently active.\n"));
291 return;
0156b218
MS
292 }
293
d02ed0bb
MM
294 printf_filtered (_("Active record target: %s\n"), t->to_shortname);
295 if (t->to_info_record != NULL)
296 t->to_info_record ();
0156b218
MS
297}
298
d02ed0bb 299/* The "record save" command. */
0156b218
MS
300
301static void
302cmd_record_save (char *args, int from_tty)
303{
304 char *recfilename, recfilename_buffer[40];
0156b218 305
d02ed0bb 306 require_record_target ();
0156b218 307
d02ed0bb 308 if (args != NULL && *args != 0)
0156b218
MS
309 recfilename = args;
310 else
311 {
312 /* Default recfile name is "gdb_record.PID". */
d02ed0bb 313 xsnprintf (recfilename_buffer, sizeof (recfilename_buffer),
dfd4cc63 314 "gdb_record.%d", ptid_get_pid (inferior_ptid));
0156b218
MS
315 recfilename = recfilename_buffer;
316 }
317
d02ed0bb 318 target_save_record (recfilename);
6b04bdb7
MS
319}
320
321/* "record goto" command. Argument is an instruction number,
322 as given by "info record".
323
324 Rewinds the recording (forward or backward) to the given instruction. */
325
d02ed0bb 326void
6b04bdb7
MS
327cmd_record_goto (char *arg, int from_tty)
328{
742ce053 329 ULONGEST insn;
6b04bdb7
MS
330
331 if (arg == NULL || *arg == '\0')
332 error (_("Command requires an argument (insn number to go to)."));
333
742ce053 334 insn = parse_and_eval_long (arg);
6b04bdb7 335
742ce053
MM
336 require_record_target ();
337 target_goto_record (insn);
338}
339
340/* The "record goto begin" command. */
341
342static void
343cmd_record_goto_begin (char *arg, int from_tty)
344{
345 if (arg != NULL && *arg != '\0')
346 error (_("Junk after argument: %s."), arg);
347
348 require_record_target ();
349 target_goto_record_begin ();
350}
351
352/* The "record goto end" command. */
353
354static void
355cmd_record_goto_end (char *arg, int from_tty)
356{
357 if (arg != NULL && *arg != '\0')
358 error (_("Junk after argument: %s."), arg);
359
360 require_record_target ();
361 target_goto_record_end ();
6b04bdb7
MS
362}
363
67c86d06
MM
364/* Read an instruction number from an argument string. */
365
366static ULONGEST
367get_insn_number (char **arg)
368{
369 ULONGEST number;
370 const char *begin, *end, *pos;
371
372 begin = *arg;
373 pos = skip_spaces_const (begin);
374
375 if (!isdigit (*pos))
376 error (_("Expected positive number, got: %s."), pos);
377
378 number = strtoulst (pos, &end, 10);
379
380 *arg += (end - begin);
381
382 return number;
383}
384
385/* Read a context size from an argument string. */
386
387static int
388get_context_size (char **arg)
389{
390 char *pos;
391 int number;
392
393 pos = skip_spaces (*arg);
394
395 if (!isdigit (*pos))
396 error (_("Expected positive number, got: %s."), pos);
397
398 return strtol (pos, arg, 10);
399}
400
401/* Complain about junk at the end of an argument string. */
402
403static void
404no_chunk (char *arg)
405{
406 if (*arg != 0)
407 error (_("Junk after argument: %s."), arg);
408}
409
410/* Read instruction-history modifiers from an argument string. */
411
412static int
413get_insn_history_modifiers (char **arg)
414{
415 int modifiers;
416 char *args;
417
418 modifiers = 0;
419 args = *arg;
420
421 if (args == NULL)
422 return modifiers;
423
424 while (*args == '/')
425 {
426 ++args;
427
428 if (*args == '\0')
429 error (_("Missing modifier."));
430
431 for (; *args; ++args)
432 {
433 if (isspace (*args))
434 break;
435
436 if (*args == '/')
437 continue;
438
439 switch (*args)
440 {
441 case 'm':
442 modifiers |= DISASSEMBLY_SOURCE;
443 modifiers |= DISASSEMBLY_FILENAME;
444 break;
445 case 'r':
446 modifiers |= DISASSEMBLY_RAW_INSN;
447 break;
448 case 'f':
449 modifiers |= DISASSEMBLY_OMIT_FNAME;
450 break;
946287b7
MM
451 case 'p':
452 modifiers |= DISASSEMBLY_OMIT_PC;
453 break;
67c86d06
MM
454 default:
455 error (_("Invalid modifier: %c."), *args);
456 }
457 }
458
459 args = skip_spaces (args);
460 }
461
462 /* Update the argument string. */
463 *arg = args;
464
465 return modifiers;
466}
467
42c634cb
PA
468/* The "set record instruction-history-size / set record
469 function-call-history-size" commands are unsigned, with UINT_MAX
470 meaning unlimited. The target interfaces works with signed int
471 though, to indicate direction, so map "unlimited" to INT_MAX, which
472 is about the same as unlimited in practice. If the user does have
0ccfeeae
MM
473 a log that huge, she can fetch it in chunks across several requests,
474 but she'll likely have other problems first... */
42c634cb
PA
475
476static int
0ccfeeae 477command_size_to_target_size (unsigned int size)
42c634cb 478{
0ccfeeae 479 gdb_assert (size <= INT_MAX || size == UINT_MAX);
42c634cb 480
0ccfeeae 481 if (size == UINT_MAX)
42c634cb
PA
482 return INT_MAX;
483 else
0ccfeeae 484 return size;
42c634cb
PA
485}
486
67c86d06
MM
487/* The "record instruction-history" command. */
488
489static void
490cmd_record_insn_history (char *arg, int from_tty)
491{
492 int flags, size;
493
494 require_record_target ();
495
496 flags = get_insn_history_modifiers (&arg);
497
0ccfeeae 498 size = command_size_to_target_size (record_insn_history_size);
67c86d06
MM
499
500 if (arg == NULL || *arg == 0 || strcmp (arg, "+") == 0)
501 target_insn_history (size, flags);
502 else if (strcmp (arg, "-") == 0)
503 target_insn_history (-size, flags);
504 else
505 {
506 ULONGEST begin, end;
507
508 begin = get_insn_number (&arg);
509
510 if (*arg == ',')
511 {
512 arg = skip_spaces (++arg);
513
514 if (*arg == '+')
515 {
516 arg += 1;
517 size = get_context_size (&arg);
518
519 no_chunk (arg);
520
521 target_insn_history_from (begin, size, flags);
522 }
523 else if (*arg == '-')
524 {
525 arg += 1;
526 size = get_context_size (&arg);
527
528 no_chunk (arg);
529
530 target_insn_history_from (begin, -size, flags);
531 }
532 else
533 {
534 end = get_insn_number (&arg);
535
536 no_chunk (arg);
537
538 target_insn_history_range (begin, end, flags);
539 }
540 }
541 else
542 {
543 no_chunk (arg);
544
545 target_insn_history_from (begin, size, flags);
546 }
547
548 dont_repeat ();
549 }
550}
551
15984c13
MM
552/* Read function-call-history modifiers from an argument string. */
553
554static int
555get_call_history_modifiers (char **arg)
556{
557 int modifiers;
558 char *args;
559
560 modifiers = 0;
561 args = *arg;
562
563 if (args == NULL)
564 return modifiers;
565
566 while (*args == '/')
567 {
568 ++args;
569
570 if (*args == '\0')
571 error (_("Missing modifier."));
572
573 for (; *args; ++args)
574 {
575 if (isspace (*args))
576 break;
577
578 if (*args == '/')
579 continue;
580
581 switch (*args)
582 {
583 case 'l':
1e038f67 584 modifiers |= RECORD_PRINT_SRC_LINE;
15984c13
MM
585 break;
586 case 'i':
1e038f67 587 modifiers |= RECORD_PRINT_INSN_RANGE;
15984c13
MM
588 break;
589 default:
590 error (_("Invalid modifier: %c."), *args);
591 }
592 }
593
594 args = skip_spaces (args);
595 }
596
597 /* Update the argument string. */
598 *arg = args;
599
600 return modifiers;
601}
602
603/* The "record function-call-history" command. */
604
605static void
606cmd_record_call_history (char *arg, int from_tty)
607{
608 int flags, size;
609
610 require_record_target ();
611
612 flags = get_call_history_modifiers (&arg);
613
0ccfeeae 614 size = command_size_to_target_size (record_call_history_size);
15984c13
MM
615
616 if (arg == NULL || *arg == 0 || strcmp (arg, "+") == 0)
617 target_call_history (size, flags);
618 else if (strcmp (arg, "-") == 0)
619 target_call_history (-size, flags);
620 else
621 {
622 ULONGEST begin, end;
623
624 begin = get_insn_number (&arg);
625
626 if (*arg == ',')
627 {
628 arg = skip_spaces (++arg);
629
630 if (*arg == '+')
631 {
632 arg += 1;
633 size = get_context_size (&arg);
634
635 no_chunk (arg);
636
637 target_call_history_from (begin, size, flags);
638 }
639 else if (*arg == '-')
640 {
641 arg += 1;
642 size = get_context_size (&arg);
643
644 no_chunk (arg);
645
646 target_call_history_from (begin, -size, flags);
647 }
648 else
649 {
650 end = get_insn_number (&arg);
651
652 no_chunk (arg);
653
654 target_call_history_range (begin, end, flags);
655 }
656 }
657 else
658 {
659 no_chunk (arg);
660
661 target_call_history_from (begin, size, flags);
662 }
663
664 dont_repeat ();
665 }
666}
667
42c634cb
PA
668/* Helper for "set record instruction-history-size" and "set record
669 function-call-history-size" input validation. COMMAND_VAR is the
670 variable registered in the command as control variable. *SETTING
671 is the real setting the command allows changing. */
672
673static void
9c37696b 674validate_history_size (unsigned int *command_var, unsigned int *setting)
42c634cb
PA
675{
676 if (*command_var != UINT_MAX && *command_var > INT_MAX)
677 {
678 unsigned int new_value = *command_var;
679
680 /* Restore previous value. */
681 *command_var = *setting;
682 error (_("integer %u out of range"), new_value);
683 }
684
685 /* Commit new value. */
686 *setting = *command_var;
687}
688
689/* Called by do_setshow_command. We only want values in the
690 [0..INT_MAX] range, while the command's machinery accepts
691 [0..UINT_MAX]. See command_size_to_target_size. */
692
693static void
694set_record_insn_history_size (char *args, int from_tty,
695 struct cmd_list_element *c)
696{
697 validate_history_size (&record_insn_history_size_setshow_var,
698 &record_insn_history_size);
699}
700
701/* Called by do_setshow_command. We only want values in the
702 [0..INT_MAX] range, while the command's machinery accepts
703 [0..UINT_MAX]. See command_size_to_target_size. */
704
705static void
706set_record_call_history_size (char *args, int from_tty,
707 struct cmd_list_element *c)
708{
709 validate_history_size (&record_call_history_size_setshow_var,
710 &record_call_history_size);
711}
712
70221824
PA
713/* Provide a prototype to silence -Wmissing-prototypes. */
714extern initialize_file_ftype _initialize_record;
715
69d05d38
HZ
716void
717_initialize_record (void)
718{
0156b218
MS
719 struct cmd_list_element *c;
720
ccce17b0
YQ
721 add_setshow_zuinteger_cmd ("record", no_class, &record_debug,
722 _("Set debugging of record/replay feature."),
723 _("Show debugging of record/replay feature."),
724 _("When enabled, debugging output for "
725 "record/replay feature is displayed."),
726 NULL, show_record_debug, &setdebuglist,
727 &showdebuglist);
69d05d38 728
67c86d06 729 add_setshow_uinteger_cmd ("instruction-history-size", no_class,
42c634cb 730 &record_insn_history_size_setshow_var, _("\
67c86d06 731Set number of instructions to print in \"record instruction-history\"."), _("\
f81d1120
PA
732Show number of instructions to print in \"record instruction-history\"."), _("\
733A size of \"unlimited\" means unlimited instructions. The default is 10."),
42c634cb
PA
734 set_record_insn_history_size, NULL,
735 &set_record_cmdlist, &show_record_cmdlist);
67c86d06 736
15984c13 737 add_setshow_uinteger_cmd ("function-call-history-size", no_class,
42c634cb 738 &record_call_history_size_setshow_var, _("\
15984c13 739Set number of function to print in \"record function-call-history\"."), _("\
f81d1120
PA
740Show number of functions to print in \"record function-call-history\"."), _("\
741A size of \"unlimited\" means unlimited lines. The default is 10."),
42c634cb
PA
742 set_record_call_history_size, NULL,
743 &set_record_cmdlist, &show_record_cmdlist);
15984c13 744
0156b218 745 c = add_prefix_cmd ("record", class_obscure, cmd_record_start,
d02ed0bb 746 _("Start recording."),
0156b218
MS
747 &record_cmdlist, "record ", 0, &cmdlist);
748 set_cmd_completer (c, filename_completer);
749
69d05d38
HZ
750 add_com_alias ("rec", "record", class_obscure, 1);
751 add_prefix_cmd ("record", class_support, set_record_command,
752 _("Set record options"), &set_record_cmdlist,
753 "set record ", 0, &setlist);
754 add_alias_cmd ("rec", "record", class_obscure, 1, &setlist);
755 add_prefix_cmd ("record", class_support, show_record_command,
756 _("Show record options"), &show_record_cmdlist,
757 "show record ", 0, &showlist);
758 add_alias_cmd ("rec", "record", class_obscure, 1, &showlist);
759 add_prefix_cmd ("record", class_support, info_record_command,
760 _("Info record options"), &info_record_cmdlist,
761 "info record ", 0, &infolist);
762 add_alias_cmd ("rec", "record", class_obscure, 1, &infolist);
763
0156b218
MS
764 c = add_cmd ("save", class_obscure, cmd_record_save,
765 _("Save the execution log to a file.\n\
766Argument is optional filename.\n\
767Default filename is 'gdb_record.<process_id>'."),
768 &record_cmdlist);
769 set_cmd_completer (c, filename_completer);
770
69d05d38
HZ
771 add_cmd ("delete", class_obscure, cmd_record_delete,
772 _("Delete the rest of execution log and start recording it anew."),
773 &record_cmdlist);
774 add_alias_cmd ("d", "delete", class_obscure, 1, &record_cmdlist);
775 add_alias_cmd ("del", "delete", class_obscure, 1, &record_cmdlist);
776
777 add_cmd ("stop", class_obscure, cmd_record_stop,
778 _("Stop the record/replay target."),
779 &record_cmdlist);
780 add_alias_cmd ("s", "stop", class_obscure, 1, &record_cmdlist);
781
742ce053 782 add_prefix_cmd ("goto", class_obscure, cmd_record_goto, _("\
6b04bdb7
MS
783Restore the program to its state at instruction number N.\n\
784Argument is instruction number, as shown by 'info record'."),
742ce053
MM
785 &record_goto_cmdlist, "record goto ", 1, &record_cmdlist);
786
787 add_cmd ("begin", class_obscure, cmd_record_goto_begin,
788 _("Go to the beginning of the execution log."),
789 &record_goto_cmdlist);
790 add_alias_cmd ("start", "begin", class_obscure, 1, &record_goto_cmdlist);
791
792 add_cmd ("end", class_obscure, cmd_record_goto_end,
793 _("Go to the end of the execution log."),
794 &record_goto_cmdlist);
67c86d06
MM
795
796 add_cmd ("instruction-history", class_obscure, cmd_record_insn_history, _("\
797Print disassembled instructions stored in the execution log.\n\
798With a /m modifier, source lines are included (if available).\n\
799With a /r modifier, raw instructions in hex are included.\n\
800With a /f modifier, function names are omitted.\n\
946287b7 801With a /p modifier, current position markers are omitted.\n\
67c86d06
MM
802With no argument, disassembles ten more instructions after the previous \
803disassembly.\n\
804\"record instruction-history -\" disassembles ten instructions before a \
805previous disassembly.\n\
806One argument specifies an instruction number as shown by 'info record', and \
807ten instructions are disassembled after that instruction.\n\
808Two arguments with comma between them specify starting and ending instruction \
809numbers to disassemble.\n\
810If the second argument is preceded by '+' or '-', it specifies the distance \
811from the first argument.\n\
812The number of instructions to disassemble can be defined with \"set record \
813instruction-history-size\"."),
814 &record_cmdlist);
15984c13
MM
815
816 add_cmd ("function-call-history", class_obscure, cmd_record_call_history, _("\
817Prints the execution history at function granularity.\n\
818It prints one line for each sequence of instructions that belong to the same \
819function.\n\
820Without modifiers, it prints the function name.\n\
821With a /l modifier, the source file and line number range is included.\n\
822With a /i modifier, the instruction number range is included.\n\
823With no argument, prints ten more lines after the previous ten-line print.\n\
824\"record function-call-history -\" prints ten lines before a previous ten-line \
825print.\n\
826One argument specifies a function number as shown by 'info record', and \
827ten lines are printed after that function.\n\
828Two arguments with comma between them specify a range of functions to print.\n\
829If the second argument is preceded by '+' or '-', it specifies the distance \
830from the first argument.\n\
831The number of functions to print can be defined with \"set record \
832function-call-history-size\"."),
833 &record_cmdlist);
42c634cb
PA
834
835 /* Sync command control variables. */
836 record_insn_history_size_setshow_var = record_insn_history_size;
837 record_call_history_size_setshow_var = record_call_history_size;
69d05d38 838}
This page took 0.519326 seconds and 4 git commands to generate.