@@ -417,70 +417,69 @@ class Debugger : public std::enable_shared_from_this<Debugger>,
417
417
// / hand, use INTERRUPT_REQUESTED so this gets done consistently.
418
418
// /
419
419
// / \param[in] formatv
420
- // / A formatv string for the interrupt message. If the elements of the
420
+ // / A formatv string for the interrupt message. If the elements of the
421
421
// / message are expensive to compute, you can use the no-argument form of
422
- // / InterruptRequested, then make up the report using REPORT_INTERRUPTION.
423
- // /
422
+ // / InterruptRequested, then make up the report using REPORT_INTERRUPTION.
423
+ // /
424
424
// / \return
425
425
// / A boolean value, if \b true an interruptible operation should interrupt
426
426
// / itself.
427
427
template <typename ... Args>
428
- bool InterruptRequested (const char *cur_func,
429
- const char *formatv, Args &&... args) {
428
+ bool InterruptRequested (const char *cur_func, const char *formatv,
429
+ Args &&...args) {
430
430
bool ret_val = InterruptRequested ();
431
431
if (ret_val) {
432
432
if (!formatv)
433
433
formatv = " Unknown message" ;
434
434
if (!cur_func)
435
435
cur_func = " <UNKNOWN>" ;
436
- ReportInterruption (InterruptionReport (cur_func,
437
- llvm::formatv (formatv,
438
- std::forward<Args>(args)...)));
436
+ ReportInterruption (InterruptionReport (
437
+ cur_func, llvm::formatv (formatv, std::forward<Args>(args)...)));
439
438
}
440
439
return ret_val;
441
440
}
442
-
443
-
441
+
444
442
// / This handy define will keep you from having to generate a report for the
445
443
// / interruption by hand. Use this except in the case where the arguments to
446
444
// / the message description are expensive to compute.
447
- #define INTERRUPT_REQUESTED (debugger, ...) \
448
- (debugger).InterruptRequested(__func__, __VA_ARGS__)
445
+ #define INTERRUPT_REQUESTED (debugger, ...) \
446
+ (debugger).InterruptRequested(__func__, __VA_ARGS__)
449
447
450
448
// This form just queries for whether to interrupt, and does no reporting:
451
449
bool InterruptRequested ();
452
-
450
+
453
451
// FIXME: Do we want to capture a backtrace at the interruption point?
454
452
class InterruptionReport {
455
453
public:
456
- InterruptionReport (std::string function_name, std::string description) :
457
- m_function_name (std::move(function_name)),
458
- m_description (std::move(description)),
459
- m_interrupt_time (std::chrono::system_clock::now()),
460
- m_thread_id (llvm::get_threadid()) {}
461
-
462
- InterruptionReport (std::string function_name,
463
- const llvm::formatv_object_base &payload);
464
-
465
- template <typename ... Args>
466
- InterruptionReport (std::string function_name,
467
- const char *format, Args &&... args) :
468
- InterruptionReport (function_name, llvm::formatv(format, std::forward<Args>(args)...)) {}
454
+ InterruptionReport (std::string function_name, std::string description)
455
+ : m_function_name(std::move(function_name)),
456
+ m_description (std::move(description)),
457
+ m_interrupt_time(std::chrono::system_clock::now()),
458
+ m_thread_id(llvm::get_threadid()) {}
459
+
460
+ InterruptionReport (std::string function_name,
461
+ const llvm::formatv_object_base &payload);
462
+
463
+ template <typename ... Args>
464
+ InterruptionReport (std::string function_name, const char *format,
465
+ Args &&...args)
466
+ : InterruptionReport(
467
+ function_name,
468
+ llvm::formatv (format, std::forward<Args>(args)...)) {}
469
469
470
470
std::string m_function_name;
471
471
std::string m_description;
472
472
const std::chrono::time_point<std::chrono::system_clock> m_interrupt_time;
473
473
const uint64_t m_thread_id;
474
474
};
475
475
void ReportInterruption (const InterruptionReport &report);
476
- #define REPORT_INTERRUPTION (debugger, ...) \
477
- (debugger).ReportInterruption(Debugger::InterruptionReport(__func__, \
478
- __VA_ARGS__))
476
+ #define REPORT_INTERRUPTION (debugger, ...) \
477
+ (debugger).ReportInterruption( \
478
+ Debugger::InterruptionReport (__func__, __VA_ARGS__))
479
479
480
480
static DebuggerList DebuggersRequestingInterruption();
481
481
482
482
public:
483
-
484
483
// This is for use in the command interpreter, when you either want the
485
484
// selected target, or if no target is present you want to prime the dummy
486
485
// target with entities that will be copied over to new targets.
0 commit comments