1 //===-- FunctionBreakpoint.cpp ----------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "FunctionBreakpoint.h" 11 #include "VSCode.h" 12 13 namespace lldb_vscode { 14 15 FunctionBreakpoint::FunctionBreakpoint(const llvm::json::Object &obj) 16 : BreakpointBase(obj), functionName(GetString(obj, "name")) {} 17 18 void FunctionBreakpoint::SetBreakpoint() { 19 if (functionName.empty()) 20 return; 21 bp = g_vsc.target.BreakpointCreateByName(functionName.c_str()); 22 if (!condition.empty()) 23 SetCondition(); 24 if (!hitCondition.empty()) 25 SetHitCondition(); 26 } 27 28 } 29