diff options
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp')
-rw-r--r-- | contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp index 9963ed6..3182388 100644 --- a/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp +++ b/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointID.cpp @@ -18,6 +18,7 @@ #include "lldb/Breakpoint/BreakpointID.h" #include "lldb/Breakpoint/Breakpoint.h" #include "lldb/Core/Stream.h" +#include "lldb/Core/Error.h" using namespace lldb; using namespace lldb_private; @@ -121,3 +122,19 @@ BreakpointID::ParseCanonicalReference (const char *input, break_id_t *break_id_p return false; } +bool +BreakpointID::StringIsBreakpointName(const char *name, Error &error) +{ + error.Clear(); + + if (name && (name[0] >= 'A' && name[0] <= 'z')) + { + if (strcspn(name, ".- ") != strlen(name)) + { + error.SetErrorStringWithFormat("invalid breakpoint name: \"%s\"", name); + } + return true; + } + else + return false; +} |