intelligently. The four name types we currently have are:
eFunctionNameTypeFull = (1 << 1), // The function name.
// For C this is the same as just the name of the function
// For C++ this is the demangled version of the mangled name.
// For ObjC this is the full function signature with the + or
// - and the square brackets and the class and selector
eFunctionNameTypeBase = (1 << 2), // The function name only, no namespaces or arguments and no class
// methods or selectors will be searched.
eFunctionNameTypeMethod = (1 << 3), // Find function by method name (C++) with no namespace or arguments
eFunctionNameTypeSelector = (1 << 4) // Find function by selector name (ObjC) names
this allows much more flexibility when setting breakoints:
(lldb) breakpoint set --name main --basename
(lldb) breakpoint set --name main --fullname
(lldb) breakpoint set --name main --method
(lldb) breakpoint set --name main --selector
The default:
(lldb) breakpoint set --name main
will inspect the name "main" and look for any parens, or if the name starts
with "-[" or "+[" and if any are found then a full name search will happen.
Else a basename search will be the default.
Fixed some command option structures so not all options are required when they
shouldn't be.
Cleaned up the breakpoint output summary.
Made the "image lookup --address <addr>" output much more verbose so it shows
all the important symbol context results. Added a GetDescription method to
many of the SymbolContext objects for the more verbose output.
llvm-svn: 107075
102 lines
2.8 KiB
C++
102 lines
2.8 KiB
C++
//===-- VMRange.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/lldb-private.h"
|
|
|
|
#include "lldb/Core/Stream.h"
|
|
#include "lldb/Core/VMRange.h"
|
|
#include <algorithm>
|
|
|
|
using namespace lldb;
|
|
using namespace lldb_private;
|
|
|
|
bool
|
|
VMRange::ContainsValue(const VMRange::collection& coll, lldb::addr_t value)
|
|
{
|
|
ValueInRangeUnaryPredicate in_range_predicate(value);
|
|
VMRange::const_iterator pos;
|
|
VMRange::const_iterator end = coll.end();
|
|
pos = std::find_if( coll.begin(), end, in_range_predicate );
|
|
if (pos != end)
|
|
return true;
|
|
return false;
|
|
}
|
|
|
|
bool
|
|
VMRange::ContainsRange(const VMRange::collection& coll, const VMRange& range)
|
|
{
|
|
RangeInRangeUnaryPredicate in_range_predicate(range);
|
|
VMRange::const_iterator pos;
|
|
VMRange::const_iterator end = coll.end();
|
|
pos = std::find_if( coll.begin(), end, in_range_predicate );
|
|
if (pos != end)
|
|
return true;
|
|
return false;
|
|
}
|
|
|
|
|
|
void
|
|
VMRange::Dump(Stream *s, lldb::addr_t offset, uint32_t addr_width) const
|
|
{
|
|
s->AddressRange(offset + GetBaseAddress(), offset + GetEndAddress(), addr_width);
|
|
}
|
|
|
|
bool
|
|
lldb_private::operator== (const VMRange& lhs, const VMRange& rhs)
|
|
{
|
|
return lhs.GetBaseAddress() == rhs.GetBaseAddress() && lhs.GetEndAddress() == rhs.GetEndAddress();
|
|
}
|
|
|
|
bool
|
|
lldb_private::operator!= (const VMRange& lhs, const VMRange& rhs)
|
|
{
|
|
return lhs.GetBaseAddress() != rhs.GetBaseAddress() || lhs.GetEndAddress() != rhs.GetEndAddress();
|
|
}
|
|
|
|
bool
|
|
lldb_private::operator< (const VMRange& lhs, const VMRange& rhs)
|
|
{
|
|
if (lhs.GetBaseAddress() < rhs.GetBaseAddress())
|
|
return true;
|
|
else if (lhs.GetBaseAddress() > rhs.GetBaseAddress())
|
|
return false;
|
|
return lhs.GetEndAddress() < rhs.GetEndAddress();
|
|
}
|
|
|
|
bool
|
|
lldb_private::operator<= (const VMRange& lhs, const VMRange& rhs)
|
|
{
|
|
if (lhs.GetBaseAddress() < rhs.GetBaseAddress())
|
|
return true;
|
|
else if (lhs.GetBaseAddress() > rhs.GetBaseAddress())
|
|
return false;
|
|
return lhs.GetEndAddress() <= rhs.GetEndAddress();
|
|
}
|
|
|
|
bool
|
|
lldb_private::operator> (const VMRange& lhs, const VMRange& rhs)
|
|
{
|
|
if (lhs.GetBaseAddress() > rhs.GetBaseAddress())
|
|
return true;
|
|
else if (lhs.GetBaseAddress() < rhs.GetBaseAddress())
|
|
return false;
|
|
return lhs.GetEndAddress() > rhs.GetEndAddress();
|
|
}
|
|
|
|
bool
|
|
lldb_private::operator>= (const VMRange& lhs, const VMRange& rhs)
|
|
{
|
|
if (lhs.GetBaseAddress() > rhs.GetBaseAddress())
|
|
return true;
|
|
else if (lhs.GetBaseAddress() < rhs.GetBaseAddress())
|
|
return false;
|
|
return lhs.GetEndAddress() >= rhs.GetEndAddress();
|
|
}
|
|
|