comparison lldb/source/Commands/CommandObjectWatchpointCommand.cpp @ 252:1f2b6ac9f198 llvm-original

LLVM16-1
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 18 Aug 2023 09:04:13 +0900
parents c4bab56944e8
children
comparison
equal deleted inserted replaced
237:c80f45b162ad 252:1f2b6ac9f198
347 m_one_liner.clear(); 347 m_one_liner.clear();
348 m_function_name.clear(); 348 m_function_name.clear();
349 } 349 }
350 350
351 llvm::ArrayRef<OptionDefinition> GetDefinitions() override { 351 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
352 return llvm::makeArrayRef(g_watchpoint_command_add_options); 352 return llvm::ArrayRef(g_watchpoint_command_add_options);
353 } 353 }
354 354
355 // Instance variables to hold the values for command options. 355 // Instance variables to hold the values for command options.
356 356
357 bool m_use_commands = false; 357 bool m_use_commands = false;
413 ScriptInterpreter *script_interp = GetDebugger().GetScriptInterpreter( 413 ScriptInterpreter *script_interp = GetDebugger().GetScriptInterpreter(
414 /*can_create=*/true, m_options.m_script_language); 414 /*can_create=*/true, m_options.m_script_language);
415 // Special handling for one-liner specified inline. 415 // Special handling for one-liner specified inline.
416 if (m_options.m_use_one_liner) { 416 if (m_options.m_use_one_liner) {
417 script_interp->SetWatchpointCommandCallback( 417 script_interp->SetWatchpointCommandCallback(
418 wp_options, m_options.m_one_liner.c_str()); 418 wp_options, m_options.m_one_liner.c_str(),
419 /*is_callback=*/false);
419 } 420 }
420 // Special handling for using a Python function by name instead of 421 // Special handling for using a Python function by name instead of
421 // extending the watchpoint callback data structures, we just 422 // extending the watchpoint callback data structures, we just
422 // automatize what the user would do manually: make their watchpoint 423 // automatize what the user would do manually: make their watchpoint
423 // command be a function call 424 // command be a function call
424 else if (!m_options.m_function_name.empty()) { 425 else if (!m_options.m_function_name.empty()) {
425 std::string oneliner(m_options.m_function_name); 426 std::string function_signature = m_options.m_function_name;
426 oneliner += "(frame, wp, internal_dict)"; 427 function_signature += "(frame, wp, internal_dict)";
427 script_interp->SetWatchpointCommandCallback( 428 script_interp->SetWatchpointCommandCallback(
428 wp_options, oneliner.c_str()); 429 wp_options, function_signature.c_str(), /*is_callback=*/true);
429 } else { 430 } else {
430 script_interp->CollectDataForWatchpointCommandCallback(wp_options, 431 script_interp->CollectDataForWatchpointCommandCallback(wp_options,
431 result); 432 result);
432 } 433 }
433 } else { 434 } else {