|
9 | 9 |
|
10 | 10 | #include "core/common/config_reader.h" |
11 | 11 | #include "core/common/debug.h" |
| 12 | +#include "core/common/error.h" |
12 | 13 | #include "core/common/api/bo_int.h" |
13 | 14 | #include "core/common/api/elf_int.h" |
14 | 15 | #include "core/common/api/hw_context_int.h" |
@@ -53,7 +54,7 @@ insert_json_object(json& dest, const json& src) |
53 | 54 | static uint64_t |
54 | 55 | to_uint64(span<const uint8_t> data) |
55 | 56 | { |
56 | | - if (data.size() > 8) |
| 57 | + if (data.size() > sizeof(uint64_t)) |
57 | 58 | throw std::runtime_error("Wrong data size"); |
58 | 59 |
|
59 | 60 | uint64_t value = 0; |
@@ -114,6 +115,7 @@ class frames |
114 | 115 | } |
115 | 116 |
|
116 | 117 | public: |
| 118 | + explicit |
117 | 119 | bo(xrt::bo bo) |
118 | 120 | : m_bo{std::move(bo)} |
119 | 121 | , m_id{get_uid()} |
@@ -208,6 +210,7 @@ class frames |
208 | 210 | } |
209 | 211 |
|
210 | 212 | public: |
| 213 | + explicit |
211 | 214 | run(const xrt::run_impl* hdl) |
212 | 215 | : m_hdl{hdl} |
213 | 216 | , m_run{xrt_core::kernel_int::get_run_from_impl(m_hdl)} |
@@ -314,6 +317,7 @@ class frames |
314 | 317 | const xrt::runlist_impl* m_hdl; |
315 | 318 | std::vector<const run*> m_runs; |
316 | 319 | public: |
| 320 | + explicit |
317 | 321 | runlist(const xrt::runlist_impl* hdl) |
318 | 322 | : m_hdl{hdl} |
319 | 323 | {} |
@@ -414,8 +418,11 @@ class frames |
414 | 418 | v->set_run(run); |
415 | 419 | } |
416 | 420 | } |
417 | | - else if constexpr (std::is_same_v<T, uint64_t>) |
418 | | - args.push_back(v); |
| 421 | + else if constexpr (std::is_same_v<T, uint64_t>) { |
| 422 | + // gcc14 comple error requires explicit help here |
| 423 | + // args.push_back(v); // fails RHEL10 (gcc14) |
| 424 | + args.emplace_back(arg_type{v}); |
| 425 | + } |
419 | 426 | }, rarg); |
420 | 427 | } |
421 | 428 | XRT_DEBUGF("<- capture_frame_start(run:0x%x)\n", run); |
@@ -532,7 +539,13 @@ class frames |
532 | 539 |
|
533 | 540 | ~frames() |
534 | 541 | { |
535 | | - save_replay_script(); |
| 542 | + try { |
| 543 | + save_replay_script(); |
| 544 | + } |
| 545 | + catch (const std::exception& ex) { |
| 546 | + xrt_core::send_exception_message("could not save replay script: " + std::string(ex.what())); |
| 547 | + } |
| 548 | + |
536 | 549 | } |
537 | 550 |
|
538 | 551 | std::string |
|
0 commit comments