2
0

replay-core.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * QEMU replay core API
  3. *
  4. * Copyright (c) 2010-2015 Institute for System Programming
  5. * of the Russian Academy of Sciences.
  6. *
  7. * This work is licensed under the terms of the GNU GPL, version 2 or later.
  8. * See the COPYING file in the top-level directory.
  9. */
  10. #ifndef EXEC_REPLAY_H
  11. #define EXEC_REPLAY_H
  12. #include "qapi/qapi-types-replay.h"
  13. extern ReplayMode replay_mode;
  14. /* Replay process control functions */
  15. /* Enables recording or saving event log with specified parameters */
  16. void replay_configure(struct QemuOpts *opts);
  17. /* Initializes timers used for snapshotting and enables events recording */
  18. void replay_start(void);
  19. /* Closes replay log file and frees other resources. */
  20. void replay_finish(void);
  21. /* Adds replay blocker with the specified error description */
  22. void replay_add_blocker(const char *feature);
  23. /* Returns name of the replay log file */
  24. const char *replay_get_filename(void);
  25. /*
  26. * Start making one step in backward direction.
  27. * Used by gdbstub for backwards debugging.
  28. * Returns true on success.
  29. */
  30. bool replay_reverse_step(void);
  31. /*
  32. * Start searching the last breakpoint/watchpoint.
  33. * Used by gdbstub for backwards debugging.
  34. * Returns true if the process successfully started.
  35. */
  36. bool replay_reverse_continue(void);
  37. /*
  38. * Returns true if replay module is processing
  39. * reverse_continue or reverse_step request
  40. */
  41. bool replay_running_debug(void);
  42. /* Called in reverse debugging mode to collect breakpoint information */
  43. void replay_breakpoint(void);
  44. /* Called when gdb is attached to gdbstub */
  45. void replay_gdb_attached(void);
  46. /* Interrupts and exceptions */
  47. /* Called by exception handler to write or read exception processing events */
  48. bool replay_exception(void);
  49. /*
  50. * Used to determine that exception is pending.
  51. * Does not proceed to the next event in the log.
  52. */
  53. bool replay_has_exception(void);
  54. /*
  55. * Called by interrupt handlers to write or read interrupt processing events.
  56. * Returns true if interrupt should be processed.
  57. */
  58. bool replay_interrupt(void);
  59. /*
  60. * Tries to read interrupt event from the file.
  61. * Returns true, when interrupt request is pending.
  62. */
  63. bool replay_has_interrupt(void);
  64. /* Processing data from random generators */
  65. /* Saves the values from the random number generator */
  66. void replay_save_random(int ret, void *buf, size_t len);
  67. /* Loads the saved values for the random number generator */
  68. int replay_read_random(void *buf, size_t len);
  69. #endif