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