llvm-project/lldb/include/lldb/API/SBStringList.h
Jim Ingham b842f2ecf0 Make breakpoint names real entities.
When introduced, breakpoint names were just tags that you could
apply to breakpoints that would allow you to refer to a breakpoint
when you couldn't capture the ID, or to refer to a collection of
breakpoints.  

This change makes the names independent holders of breakpoint options
that you can then apply to breakpoints when you add the name to the
breakpoint.  It adds the "breakpoint name configure" command to set
up or reconfigure breakpoint names.  There is also full support for
then in the SB API, including a new SBBreakpointName class.

The connection between the name and the breakpoints
sharing the name remains live, so if you reconfigure the name, all the
breakpoint options all change as well.  This allows a quick way
to share complex breakpoint behavior among a bunch of breakpoints, and
a convenient way to iterate on the set.

You can also create a name from a breakpoint, allowing a quick way
to copy options from one breakpoint to another.

I also added the ability to make hidden and delete/disable protected
names.  When applied to a breakpoint, you will only be able to list,
delete or disable that breakpoint if you refer to it explicitly by ID.

This feature will allow GUI's that need to use breakpoints for their
own purposes to keep their breakpoints from getting accidentally 
disabled or deleted.

<rdar://problem/22094452>

llvm-svn: 313292
2017-09-14 20:22:49 +00:00

65 lines
1.4 KiB
C++

//===-- SBStringList.h ------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLDB_SBStringList_h_
#define LLDB_SBStringList_h_
#include "lldb/API/SBDefines.h"
namespace lldb {
class LLDB_API SBStringList {
public:
SBStringList();
SBStringList(const lldb::SBStringList &rhs);
const SBStringList &operator=(const SBStringList &rhs);
~SBStringList();
bool IsValid() const;
void AppendString(const char *str);
void AppendList(const char **strv, int strc);
void AppendList(const lldb::SBStringList &strings);
uint32_t GetSize() const;
const char *GetStringAtIndex(size_t idx);
const char *GetStringAtIndex(size_t idx) const;
void Clear();
protected:
friend class SBCommandInterpreter;
friend class SBDebugger;
friend class SBBreakpoint;
friend class SBBreakpointLocation;
friend class SBBreakpointName;
SBStringList(const lldb_private::StringList *lldb_strings);
void AppendList(const lldb_private::StringList &strings);
const lldb_private::StringList *operator->() const;
const lldb_private::StringList &operator*() const;
private:
std::unique_ptr<lldb_private::StringList> m_opaque_ap;
};
} // namespace lldb
#endif // LLDB_SBStringList_h_