llvm-project/lldb/source/Breakpoint/BreakpointResolver.cpp
Johnny Chen b7234e4014 Check in an initial implementation of the "breakpoint clear" command, whose purpose is clear
the breakpoint associated with the (filename, line_number) combo when an arrow is pointing to
a source position using Emacs Grand Unified Debugger library to interact with lldb.

The current implmentation is insufficient in that it only asks the breakpoint whether it is
associated with a breakpoint resolver with FileLine type and whether it matches the (filename, line_number)
combo.  There are other breakpoint resolver types whose breakpoint locations can potentially
match the (filename, line_number) combo.

The BreakpointResolver, BreakpointResolverName, BreakpointResolverAddress, and BreakpointResolverFileLine
classes have extra static classof methods to support LLVM style type inquiry through isa, cast, and dyn_cast.

The Breakpoint class has an API method bool GetMatchingFileLine(...) which is invoked from CommandObjectBreak.cpp
to implement the "breakpoint clear" command.

llvm-svn: 117562
2010-10-28 17:27:46 +00:00

62 lines
1.6 KiB
C++

//===-- BreakpointResolver.cpp ----------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "lldb/Breakpoint/BreakpointResolver.h"
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Core/Address.h"
#include "lldb/Breakpoint/Breakpoint.h"
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/Log.h"
#include "lldb/Core/ModuleList.h"
#include "lldb/Core/SearchFilter.h"
#include "lldb/Core/Stream.h"
#include "lldb/Core/StreamString.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Target/Target.h"
#include "lldb/lldb-private-log.h"
using namespace lldb_private;
//----------------------------------------------------------------------
// BreakpointResolver:
//----------------------------------------------------------------------
BreakpointResolver::BreakpointResolver (Breakpoint *bkpt, const unsigned char resolverTy) :
m_breakpoint (bkpt),
SubclassID (resolverTy)
{
}
BreakpointResolver::~BreakpointResolver ()
{
}
void
BreakpointResolver::SetBreakpoint (Breakpoint *bkpt)
{
m_breakpoint = bkpt;
}
void
BreakpointResolver::ResolveBreakpointInModules (SearchFilter &filter, ModuleList &modules)
{
filter.SearchInModuleList(*this, modules);
}
void
BreakpointResolver::ResolveBreakpoint (SearchFilter &filter)
{
filter.Search (*this);
}