GDB (xrefs)
Loading...
Searching...
No Matches
record.c
Go to the documentation of this file.
1/* Process record and replay target for GDB, the GNU debugger.
2
3 Copyright (C) 2008-2023 Free Software Foundation, Inc.
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"
22#include "completer.h"
23#include "record.h"
24#include "observable.h"
25#include "inferior.h"
26#include "gdbsupport/common-utils.h"
27#include "cli/cli-utils.h"
28#include "disasm.h"
29#include "interps.h"
30
31#include <ctype.h>
32
33/* This is the debug switch for process record. */
34unsigned int record_debug = 0;
35
36/* The number of instructions to print in "record instruction-history". */
37static unsigned int record_insn_history_size = 10;
38
39/* The variable registered as control variable in the "record
40 instruction-history" command. Necessary for extra input
41 validation. */
43
44/* The number of functions to print in "record function-call-history". */
45static unsigned int record_call_history_size = 10;
46
47/* The variable registered as control variable in the "record
48 call-history" command. Necessary for extra input validation. */
50
56
57#define DEBUG(msg, args...) \
58 if (record_debug) \
59 gdb_printf (gdb_stdlog, "record: " msg "\n", ##args)
60
61/* See record.h. */
62
63struct target_ops *
68
69/* Check that recording is active. Throw an error, if it isn't. */
70
71static struct target_ops *
73{
74 struct target_ops *t;
75
76 t = find_record_target ();
77 if (t == NULL)
78 error (_("No recording is currently active.\n"
79 "Use the \"record full\" or \"record btrace\" command first."));
80
81 return t;
82}
83
84/* See record.h. */
85
86void
88{
89 /* Check if a record target is already running. */
90 if (find_record_target () != NULL)
91 error (_("The process is already being recorded. Use \"record stop\" to "
92 "stop recording first."));
93}
94
95/* See record.h. */
96
97void
98record_start (const char *method, const char *format, int from_tty)
99{
100 if (method == NULL)
101 {
102 if (format == NULL)
103 execute_command_to_string ("record", from_tty, false);
104 else
105 error (_("Invalid format."));
106 }
107 else if (strcmp (method, "full") == 0)
108 {
109 if (format == NULL)
110 execute_command_to_string ("record full", from_tty, false);
111 else
112 error (_("Invalid format."));
113 }
114 else if (strcmp (method, "btrace") == 0)
115 {
116 if (format == NULL)
117 execute_command_to_string ("record btrace", from_tty, false);
118 else if (strcmp (format, "bts") == 0)
119 execute_command_to_string ("record btrace bts", from_tty, false);
120 else if (strcmp (format, "pt") == 0)
121 execute_command_to_string ("record btrace pt", from_tty, false);
122 else
123 error (_("Invalid format."));
124 }
125 else
126 error (_("Invalid method."));
127}
128
129/* See record.h. */
130
131void
132record_stop (int from_tty)
133{
134 execute_command_to_string ("record stop", from_tty, false);
135}
136
137/* See record.h. */
138
139int
141 CORE_ADDR memaddr, gdb_byte *myaddr,
142 ssize_t len)
143{
144 int ret = target_read_memory (memaddr, myaddr, len);
145
146 if (ret != 0)
147 DEBUG ("error reading memory at addr %s len = %ld.\n",
148 paddress (gdbarch, memaddr), (long) len);
149
150 return ret;
151}
152
153/* Stop recording. */
154
155static void
157{
158 DEBUG ("stop %s", t->shortname ());
159
160 t->stop_recording ();
161}
162
163/* Unpush the record target. */
164
165static void
167{
168 DEBUG ("unpush %s", t->shortname ());
169
171}
172
173/* See record.h. */
174
175void
176record_disconnect (struct target_ops *t, const char *args, int from_tty)
177{
178 gdb_assert (t->stratum () == record_stratum);
179
180 DEBUG ("disconnect %s", t->shortname ());
181
182 record_stop (t);
183 record_unpush (t);
184
185 target_disconnect (args, from_tty);
186}
187
188/* See record.h. */
189
190void
191record_detach (struct target_ops *t, inferior *inf, int from_tty)
192{
193 gdb_assert (t->stratum () == record_stratum);
194
195 DEBUG ("detach %s", t->shortname ());
196
197 record_stop (t);
198 record_unpush (t);
199
200 target_detach (inf, from_tty);
201}
202
203/* See record.h. */
204
205void
207{
208 gdb_assert (t->stratum () == record_stratum);
209
210 DEBUG ("mourn inferior %s", t->shortname ());
211
212 /* It is safer to not stop recording. Resources will be freed when
213 threads are discarded. */
214 record_unpush (t);
215
217}
218
219/* See record.h. */
220
221void
223{
224 gdb_assert (t->stratum () == record_stratum);
225
226 DEBUG ("kill %s", t->shortname ());
227
228 /* It is safer to not stop recording. Resources will be freed when
229 threads are discarded. */
230 record_unpush (t);
231
232 target_kill ();
233}
234
235/* See record.h. */
236
237int
239 CORE_ADDR pc,
240 enum target_stop_reason *reason)
241{
242 if (breakpoint_inserted_here_p (aspace, pc))
243 {
246 else
248 return 1;
249 }
250
252 return 0;
253}
254
255/* Implement "show record debug" command. */
256
257static void
258show_record_debug (struct ui_file *file, int from_tty,
259 struct cmd_list_element *c, const char *value)
260{
261 gdb_printf (file, _("Debugging of process record target is %s.\n"),
262 value);
263}
264
265/* Alias for "target record". */
266
267static void
268cmd_record_start (const char *args, int from_tty)
269{
270 execute_command ("target record-full", from_tty);
271}
272
273/* Truncate the record log from the present point
274 of replay until the end. */
275
276static void
277cmd_record_delete (const char *args, int from_tty)
278{
280
282 {
283 gdb_printf (_("Already at end of record list.\n"));
284 return;
285 }
286
288 {
289 gdb_printf (_("The current record target does not support "
290 "this operation.\n"));
291 return;
292 }
293
294 if (!from_tty || query (_("Delete the log from this point forward "
295 "and begin to record the running message "
296 "at current PC?")))
298}
299
300/* Implement the "stoprecord" or "record stop" command. */
301
302static void
303cmd_record_stop (const char *args, int from_tty)
304{
305 struct target_ops *t;
306
308
309 record_stop (t);
310 record_unpush (t);
311
312 gdb_printf (_("Process record is stopped and all execution "
313 "logs are deleted.\n"));
314
316}
317
318
319/* The "info record" command. */
320
321static void
322info_record_command (const char *args, int from_tty)
323{
324 struct target_ops *t;
325
326 t = find_record_target ();
327 if (t == NULL)
328 {
329 gdb_printf (_("No recording is currently active.\n"));
330 return;
331 }
332
333 gdb_printf (_("Active record target: %s\n"), t->shortname ());
334 t->info_record ();
335}
336
337/* The "record save" command. */
338
339static void
340cmd_record_save (const char *args, int from_tty)
341{
342 const char *recfilename;
343 char recfilename_buffer[40];
344
346
347 if (args != NULL && *args != 0)
348 recfilename = args;
349 else
350 {
351 /* Default recfile name is "gdb_record.PID". */
352 xsnprintf (recfilename_buffer, sizeof (recfilename_buffer),
353 "gdb_record.%d", inferior_ptid.pid ());
354 recfilename = recfilename_buffer;
355 }
356
357 target_save_record (recfilename);
358}
359
360/* See record.h. */
361
362void
363record_goto (const char *arg)
364{
365 ULONGEST insn;
366
367 if (arg == NULL || *arg == '\0')
368 error (_("Command requires an argument (insn number to go to)."));
369
370 insn = parse_and_eval_long (arg);
371
373 target_goto_record (insn);
374}
375
376/* "record goto" command. Argument is an instruction number,
377 as given by "info record".
378
379 Rewinds the recording (forward or backward) to the given instruction. */
380
381static void
382cmd_record_goto (const char *arg, int from_tty)
383{
384 record_goto (arg);
385}
386
387/* The "record goto begin" command. */
388
389static void
390cmd_record_goto_begin (const char *arg, int from_tty)
391{
392 if (arg != NULL && *arg != '\0')
393 error (_("Junk after argument: %s."), arg);
394
397}
398
399/* The "record goto end" command. */
400
401static void
402cmd_record_goto_end (const char *arg, int from_tty)
403{
404 if (arg != NULL && *arg != '\0')
405 error (_("Junk after argument: %s."), arg);
406
409}
410
411/* Read an instruction number from an argument string. */
412
413static ULONGEST
414get_insn_number (const char **arg)
415{
416 ULONGEST number;
417 const char *begin, *end, *pos;
418
419 begin = *arg;
420 pos = skip_spaces (begin);
421
422 if (!isdigit (*pos))
423 error (_("Expected positive number, got: %s."), pos);
424
425 number = strtoulst (pos, &end, 10);
426
427 *arg += (end - begin);
428
429 return number;
430}
431
432/* Read a context size from an argument string. */
433
434static int
435get_context_size (const char **arg)
436{
437 const char *pos;
438 char *end;
439
440 pos = skip_spaces (*arg);
441
442 if (!isdigit (*pos))
443 error (_("Expected positive number, got: %s."), pos);
444
445 long result = strtol (pos, &end, 10);
446 *arg = end;
447 return result;
448}
449
450/* Complain about junk at the end of an argument string. */
451
452static void
453no_chunk (const char *arg)
454{
455 if (*arg != 0)
456 error (_("Junk after argument: %s."), arg);
457}
458
459/* Read instruction-history modifiers from an argument string. */
460
461static gdb_disassembly_flags
463{
464 gdb_disassembly_flags modifiers;
465 const char *args;
466
467 modifiers = 0;
468 args = *arg;
469
470 if (args == NULL)
471 return modifiers;
472
473 while (*args == '/')
474 {
475 ++args;
476
477 if (*args == '\0')
478 error (_("Missing modifier."));
479
480 for (; *args; ++args)
481 {
482 if (isspace (*args))
483 break;
484
485 if (*args == '/')
486 continue;
487
488 switch (*args)
489 {
490 case 'm':
491 case 's':
492 modifiers |= DISASSEMBLY_SOURCE;
493 modifiers |= DISASSEMBLY_FILENAME;
494 break;
495 case 'r':
496 modifiers |= DISASSEMBLY_RAW_INSN;
497 break;
498 case 'b':
499 modifiers |= DISASSEMBLY_RAW_BYTES;
500 break;
501 case 'f':
502 modifiers |= DISASSEMBLY_OMIT_FNAME;
503 break;
504 case 'p':
505 modifiers |= DISASSEMBLY_OMIT_PC;
506 break;
507 default:
508 error (_("Invalid modifier: %c."), *args);
509 }
510 }
511
512 args = skip_spaces (args);
513 }
514
515 /* Update the argument string. */
516 *arg = args;
517
518 return modifiers;
519}
520
521/* The "set record instruction-history-size / set record
522 function-call-history-size" commands are unsigned, with UINT_MAX
523 meaning unlimited. The target interfaces works with signed int
524 though, to indicate direction, so map "unlimited" to INT_MAX, which
525 is about the same as unlimited in practice. If the user does have
526 a log that huge, she can fetch it in chunks across several requests,
527 but she'll likely have other problems first... */
528
529static int
531{
532 gdb_assert (size <= INT_MAX || size == UINT_MAX);
533
534 if (size == UINT_MAX)
535 return INT_MAX;
536 else
537 return size;
538}
539
540/* The "record instruction-history" command. */
541
542static void
543cmd_record_insn_history (const char *arg, int from_tty)
544{
546
547 gdb_disassembly_flags flags = get_insn_history_modifiers (&arg);
548
550
551 if (arg == NULL || *arg == 0 || strcmp (arg, "+") == 0)
553 else if (strcmp (arg, "-") == 0)
555 else
556 {
557 ULONGEST begin, end;
558
559 begin = get_insn_number (&arg);
560
561 if (*arg == ',')
562 {
563 arg = skip_spaces (++arg);
564
565 if (*arg == '+')
566 {
567 arg += 1;
568 size = get_context_size (&arg);
569
570 no_chunk (arg);
571
573 }
574 else if (*arg == '-')
575 {
576 arg += 1;
577 size = get_context_size (&arg);
578
579 no_chunk (arg);
580
582 }
583 else
584 {
585 end = get_insn_number (&arg);
586
587 no_chunk (arg);
588
589 target_insn_history_range (begin, end, flags);
590 }
591 }
592 else
593 {
594 no_chunk (arg);
595
597 }
598
599 dont_repeat ();
600 }
601}
602
603/* Read function-call-history modifiers from an argument string. */
604
605static record_print_flags
607{
608 record_print_flags modifiers = 0;
609 const char *args = *arg;
610
611 if (args == NULL)
612 return modifiers;
613
614 while (*args == '/')
615 {
616 ++args;
617
618 if (*args == '\0')
619 error (_("Missing modifier."));
620
621 for (; *args; ++args)
622 {
623 if (isspace (*args))
624 break;
625
626 if (*args == '/')
627 continue;
628
629 switch (*args)
630 {
631 case 'l':
632 modifiers |= RECORD_PRINT_SRC_LINE;
633 break;
634 case 'i':
635 modifiers |= RECORD_PRINT_INSN_RANGE;
636 break;
637 case 'c':
638 modifiers |= RECORD_PRINT_INDENT_CALLS;
639 break;
640 default:
641 error (_("Invalid modifier: %c."), *args);
642 }
643 }
644
645 args = skip_spaces (args);
646 }
647
648 /* Update the argument string. */
649 *arg = args;
650
651 return modifiers;
652}
653
654/* The "record function-call-history" command. */
655
656static void
657cmd_record_call_history (const char *arg, int from_tty)
658{
660
661 record_print_flags flags = get_call_history_modifiers (&arg);
662
664
665 if (arg == NULL || *arg == 0 || strcmp (arg, "+") == 0)
667 else if (strcmp (arg, "-") == 0)
669 else
670 {
671 ULONGEST begin, end;
672
673 begin = get_insn_number (&arg);
674
675 if (*arg == ',')
676 {
677 arg = skip_spaces (++arg);
678
679 if (*arg == '+')
680 {
681 arg += 1;
682 size = get_context_size (&arg);
683
684 no_chunk (arg);
685
687 }
688 else if (*arg == '-')
689 {
690 arg += 1;
691 size = get_context_size (&arg);
692
693 no_chunk (arg);
694
696 }
697 else
698 {
699 end = get_insn_number (&arg);
700
701 no_chunk (arg);
702
703 target_call_history_range (begin, end, flags);
704 }
705 }
706 else
707 {
708 no_chunk (arg);
709
711 }
712
713 dont_repeat ();
714 }
715}
716
717/* Helper for "set record instruction-history-size" and "set record
718 function-call-history-size" input validation. COMMAND_VAR is the
719 variable registered in the command as control variable. *SETTING
720 is the real setting the command allows changing. */
721
722static void
723validate_history_size (unsigned int *command_var, unsigned int *setting)
724{
725 if (*command_var != UINT_MAX && *command_var > INT_MAX)
726 {
727 unsigned int new_value = *command_var;
728
729 /* Restore previous value. */
730 *command_var = *setting;
731 error (_("integer %u out of range"), new_value);
732 }
733
734 /* Commit new value. */
735 *setting = *command_var;
736}
737
738/* Called by do_setshow_command. We only want values in the
739 [0..INT_MAX] range, while the command's machinery accepts
740 [0..UINT_MAX]. See command_size_to_target_size. */
741
742static void
749
750/* Called by do_setshow_command. We only want values in the
751 [0..INT_MAX] range, while the command's machinery accepts
752 [0..UINT_MAX]. See command_size_to_target_size. */
753
754static void
761
762void _initialize_record ();
763void
765{
766 struct cmd_list_element *c;
767
769 _("Set debugging of record/replay feature."),
770 _("Show debugging of record/replay feature."),
771 _("When enabled, debugging output for "
772 "record/replay feature is displayed."),
775
776 add_setshow_uinteger_cmd ("instruction-history-size", no_class,
778Set number of instructions to print in \"record instruction-history\"."), _("\
779Show number of instructions to print in \"record instruction-history\"."), _("\
780A size of \"unlimited\" means unlimited instructions. The default is 10."),
783
784 add_setshow_uinteger_cmd ("function-call-history-size", no_class,
786Set number of function to print in \"record function-call-history\"."), _("\
787Show number of functions to print in \"record function-call-history\"."), _("\
788A size of \"unlimited\" means unlimited lines. The default is 10."),
791
792 cmd_list_element *record_cmd
794 _("Start recording."),
795 &record_cmdlist, 0, &cmdlist);
797
798 add_com_alias ("rec", record_cmd, class_obscure, 1);
799
800 set_show_commands setshow_record_cmds
802 _("Set record options."),
803 _("Show record options."),
805 &setlist, &showlist);
806
807
808 add_alias_cmd ("rec", setshow_record_cmds.set, class_obscure, 1, &setlist);
809 add_alias_cmd ("rec", setshow_record_cmds.show, class_obscure, 1, &showlist);
810
811 cmd_list_element *info_record_cmd
813 _("Info record options."), &info_record_cmdlist,
814 0, &infolist);
815 add_alias_cmd ("rec", info_record_cmd, class_obscure, 1, &infolist);
816
818 _("Save the execution log to a file.\n\
819Usage: record save [FILENAME]\n\
820Default filename is 'gdb_record.PROCESS_ID'."),
823
824 cmd_list_element *record_delete_cmd
826 _("Delete the rest of execution log and start recording it \
827anew."),
829 add_alias_cmd ("d", record_delete_cmd, class_obscure, 1, &record_cmdlist);
830 add_alias_cmd ("del", record_delete_cmd, class_obscure, 1, &record_cmdlist);
831
832 cmd_list_element *record_stop_cmd
834 _("Stop the record/replay target."),
836 add_alias_cmd ("s", record_stop_cmd, class_obscure, 1, &record_cmdlist);
837
839Restore the program to its state at instruction number N.\n\
840Argument is instruction number, as shown by 'info record'."),
842
843 cmd_list_element *record_goto_begin_cmd
845 _("Go to the beginning of the execution log."),
847 add_alias_cmd ("start", record_goto_begin_cmd, class_obscure, 1,
849
851 _("Go to the end of the execution log."),
853
854 add_cmd ("instruction-history", class_obscure, cmd_record_insn_history, _("\
855Print disassembled instructions stored in the execution log.\n\
856With a /m or /s modifier, source lines are included (if available).\n\
857With a /r modifier, raw instructions in hex are included.\n\
858With a /f modifier, function names are omitted.\n\
859With a /p modifier, current position markers are omitted.\n\
860With no argument, disassembles ten more instructions after the previous \
861disassembly.\n\
862\"record instruction-history -\" disassembles ten instructions before a \
863previous disassembly.\n\
864One argument specifies an instruction number as shown by 'info record', and \
865ten instructions are disassembled after that instruction.\n\
866Two arguments with comma between them specify starting and ending instruction \
867numbers to disassemble.\n\
868If the second argument is preceded by '+' or '-', it specifies the distance \
869from the first argument.\n\
870The number of instructions to disassemble can be defined with \"set record \
871instruction-history-size\"."),
873
874 add_cmd ("function-call-history", class_obscure, cmd_record_call_history, _("\
875Prints the execution history at function granularity.\n\
876It prints one line for each sequence of instructions that belong to the same \
877function.\n\
878Without modifiers, it prints the function name.\n\
879With a /l modifier, the source file and line number range is included.\n\
880With a /i modifier, the instruction number range is included.\n\
881With a /c modifier, the output is indented based on the call stack depth.\n\
882With no argument, prints ten more lines after the previous ten-line print.\n\
883\"record function-call-history -\" prints ten lines before a previous ten-line \
884print.\n\
885One argument specifies a function number as shown by 'info record', and \
886ten lines are printed after that function.\n\
887Two arguments with comma between them specify a range of functions to print.\n\
888If the second argument is preceded by '+' or '-', it specifies the distance \
889from the first argument.\n\
890The number of functions to print can be defined with \"set record \
891function-call-history-size\"."),
893
894 /* Sync command control variables. */
897}
int hardware_breakpoint_inserted_here_p(const address_space *aspace, CORE_ADDR pc)
int breakpoint_inserted_here_p(const address_space *aspace, CORE_ADDR pc)
int unpush_target(struct target_ops *t)
Definition inferior.c:96
struct cmd_list_element * showlist
Definition cli-cmds.c:127
struct cmd_list_element * infolist
Definition cli-cmds.c:91
struct cmd_list_element * cmdlist
Definition cli-cmds.c:87
struct cmd_list_element * setlist
Definition cli-cmds.c:119
struct cmd_list_element * showdebuglist
Definition cli-cmds.c:167
struct cmd_list_element * setdebuglist
Definition cli-cmds.c:165
struct cmd_list_element * add_alias_cmd(const char *name, cmd_list_element *target, enum command_class theclass, int abbrev_flag, struct cmd_list_element **list)
Definition cli-decode.c:294
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
Definition cli-decode.c:233
cmd_list_element * add_com_alias(const char *name, cmd_list_element *target, command_class theclass, int abbrev_flag)
void set_cmd_completer(struct cmd_list_element *cmd, completer_ftype *completer)
Definition cli-decode.c:117
set_show_commands add_setshow_uinteger_cmd(const char *name, enum command_class theclass, unsigned int *var, const literal_def *extra_literals, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
set_show_commands add_setshow_prefix_cmd(const char *name, command_class theclass, const char *set_doc, const char *show_doc, cmd_list_element **set_subcommands_list, cmd_list_element **show_subcommands_list, cmd_list_element **set_list, cmd_list_element **show_list)
Definition cli-decode.c:428
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc, struct cmd_list_element **subcommands, int allow_unknown, struct cmd_list_element **list)
Definition cli-decode.c:357
set_show_commands add_setshow_zuinteger_cmd(const char *name, enum command_class theclass, unsigned int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void dont_repeat()
Definition top.c:696
@ class_obscure
Definition command.h:64
@ class_support
Definition command.h:58
@ no_class
Definition command.h:53
void filename_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
Definition completer.c:204
@ DISASSEMBLY_RAW_INSN
@ DISASSEMBLY_RAW_BYTES
@ DISASSEMBLY_SOURCE
@ DISASSEMBLY_OMIT_FNAME
@ DISASSEMBLY_FILENAME
@ DISASSEMBLY_OMIT_PC
LONGEST parse_and_eval_long(const char *exp)
Definition eval.c:62
void execute_command_to_string(std::string &res, const char *p, int from_tty, bool term_out)
Definition top.c:670
void execute_command(const char *, int)
Definition top.c:459
mach_port_t kern_return_t mach_port_t mach_msg_type_name_t msgportsPoly mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
Definition gnu-nat.c:1861
size_t size
Definition go32-nat.c:239
ptid_t inferior_ptid
Definition infcmd.c:74
struct inferior * current_inferior(void)
Definition inferior.c:55
void interps_notify_record_changed(inferior *inf, int started, const char *method, const char *format)
Definition interps.c:474
void record_detach(struct target_ops *t, inferior *inf, int from_tty)
Definition record.c:191
static unsigned int record_call_history_size
Definition record.c:45
unsigned int record_debug
Definition record.c:34
struct cmd_list_element * set_record_cmdlist
Definition record.c:53
static unsigned int record_insn_history_size
Definition record.c:37
static void cmd_record_goto_end(const char *arg, int from_tty)
Definition record.c:402
struct cmd_list_element * info_record_cmdlist
Definition record.c:55
static void cmd_record_stop(const char *args, int from_tty)
Definition record.c:303
static void no_chunk(const char *arg)
Definition record.c:453
void record_goto(const char *arg)
Definition record.c:363
int record_read_memory(struct gdbarch *gdbarch, CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
Definition record.c:140
static void set_record_call_history_size(const char *args, int from_tty, struct cmd_list_element *c)
Definition record.c:755
static gdb_disassembly_flags get_insn_history_modifiers(const char **arg)
Definition record.c:462
static unsigned int record_call_history_size_setshow_var
Definition record.c:49
struct cmd_list_element * show_record_cmdlist
Definition record.c:54
static record_print_flags get_call_history_modifiers(const char **arg)
Definition record.c:606
static void record_unpush(struct target_ops *t)
Definition record.c:166
static struct cmd_list_element * record_goto_cmdlist
Definition record.c:52
#define DEBUG(msg, args...)
Definition record.c:57
void record_disconnect(struct target_ops *t, const char *args, int from_tty)
Definition record.c:176
static void cmd_record_save(const char *args, int from_tty)
Definition record.c:340
static void show_record_debug(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
Definition record.c:258
static void cmd_record_call_history(const char *arg, int from_tty)
Definition record.c:657
static int command_size_to_target_size(unsigned int size)
Definition record.c:530
static void cmd_record_goto_begin(const char *arg, int from_tty)
Definition record.c:390
static void cmd_record_insn_history(const char *arg, int from_tty)
Definition record.c:543
struct cmd_list_element * record_cmdlist
Definition record.c:51
void record_stop(int from_tty)
Definition record.c:132
static int get_context_size(const char **arg)
Definition record.c:435
struct target_ops * find_record_target(void)
Definition record.c:64
void record_preopen(void)
Definition record.c:87
static void cmd_record_start(const char *args, int from_tty)
Definition record.c:268
static ULONGEST get_insn_number(const char **arg)
Definition record.c:414
void record_mourn_inferior(struct target_ops *t)
Definition record.c:206
static void cmd_record_delete(const char *args, int from_tty)
Definition record.c:277
static void info_record_command(const char *args, int from_tty)
Definition record.c:322
static void validate_history_size(unsigned int *command_var, unsigned int *setting)
Definition record.c:723
void record_kill(struct target_ops *t)
Definition record.c:222
static void set_record_insn_history_size(const char *args, int from_tty, struct cmd_list_element *c)
Definition record.c:743
int record_check_stopped_by_breakpoint(const address_space *aspace, CORE_ADDR pc, enum target_stop_reason *reason)
Definition record.c:238
void _initialize_record()
Definition record.c:764
static void cmd_record_goto(const char *arg, int from_tty)
Definition record.c:382
static struct target_ops * require_record_target(void)
Definition record.c:72
void record_start(const char *method, const char *format, int from_tty)
Definition record.c:98
static unsigned int record_insn_history_size_setshow_var
Definition record.c:42
@ RECORD_PRINT_SRC_LINE
Definition record.h:59
@ RECORD_PRINT_INSN_RANGE
Definition record.h:62
@ RECORD_PRINT_INDENT_CALLS
Definition record.h:65
Definition gnu-nat.c:153
cmd_list_element * set
Definition command.h:422
cmd_list_element * show
Definition command.h:422
virtual void info_record() TARGET_DEFAULT_IGNORE()
virtual strata stratum() const =0
const char * shortname() const
Definition target.h:456
virtual void stop_recording() TARGET_DEFAULT_IGNORE()
Definition value.h:130
void target_goto_record(ULONGEST insn)
Definition target.c:4172
void target_call_history_from(ULONGEST begin, int size, record_print_flags flags)
Definition target.c:4214
int target_supports_delete_record()
Definition target.c:4108
void target_insn_history_range(ULONGEST begin, ULONGEST end, gdb_disassembly_flags flags)
Definition target.c:4197
void target_insn_history(int size, gdb_disassembly_flags flags)
Definition target.c:4180
void target_goto_record_end(void)
Definition target.c:4164
void target_call_history(int size, record_print_flags flags)
Definition target.c:4206
int target_record_is_replaying(ptid_t ptid)
Definition target.c:4132
void target_insn_history_from(ULONGEST from, int size, gdb_disassembly_flags flags)
Definition target.c:4188
void target_detach(inferior *inf, int from_tty)
Definition target.c:2531
void target_kill(void)
Definition target.c:913
void target_call_history_range(ULONGEST begin, ULONGEST end, record_print_flags flags)
Definition target.c:4222
void target_save_record(const char *filename)
Definition target.c:4100
void target_disconnect(const char *args, int from_tty)
Definition target.c:2573
struct target_ops * find_target_at(enum strata stratum)
Definition target.c:3612
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
Definition target.c:1785
void target_goto_record_begin(void)
Definition target.c:4156
void target_delete_record(void)
Definition target.c:4116
void target_mourn_inferior(ptid_t ptid)
Definition target.c:2758
@ record_stratum
Definition target.h:99
int query(const char *ctlstr,...)
Definition utils.c:943
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
Definition utils.c:3166
void gdb_printf(struct ui_file *stream, const char *format,...)
Definition utils.c:1886
target_stop_reason
Definition waitstatus.h:428
@ TARGET_STOPPED_BY_SW_BREAKPOINT
Definition waitstatus.h:434
@ TARGET_STOPPED_BY_HW_BREAKPOINT
Definition waitstatus.h:437
@ TARGET_STOPPED_BY_NO_REASON
Definition waitstatus.h:431