Reflow paragraphs in comments.

This is intended as a clean up after the big clang-format commit
(r280751), which unfortunately resulted in many of the comment
paragraphs in LLDB being very hard to read.

FYI, the script I used was:

import textwrap
import commands
import os
import sys
import re
tmp = "%s.tmp"%sys.argv[1]
out = open(tmp, "w+")
with open(sys.argv[1], "r") as f:
  header = ""
  text = ""
  comment = re.compile(r'^( *//) ([^ ].*)$')
  special = re.compile(r'^((([A-Z]+[: ])|([0-9]+ )).*)|(.*;)$')
  for line in f:
      match = comment.match(line)
      if match and not special.match(match.group(2)):
          # skip intentionally short comments.
          if not text and len(match.group(2)) < 40:
              out.write(line)
              continue

          if text:
              text += " " + match.group(2)
          else:
              header = match.group(1)
              text = match.group(2)

          continue

      if text:
          filled = textwrap.wrap(text, width=(78-len(header)),
                                 break_long_words=False)
          for l in filled:
              out.write(header+" "+l+'\n')
              text = ""

      out.write(line)

os.rename(tmp, sys.argv[1])

Differential Revision: https://reviews.llvm.org/D46144

llvm-svn: 331197
This commit is contained in:
Adrian Prantl 2018-04-30 16:49:04 +00:00
parent add59c052d
commit 05097246f3
604 changed files with 11186 additions and 13434 deletions

View File

@ -54,9 +54,9 @@ public:
lldb::SBSymbolContext GetSymbolContext(uint32_t resolve_scope);
// The following functions grab individual objects for a given address and
// are less efficient if you want more than one symbol related objects.
// Use one of the following when you want multiple debug symbol related
// objects for an address:
// are less efficient if you want more than one symbol related objects. Use
// one of the following when you want multiple debug symbol related objects
// for an address:
// lldb::SBSymbolContext SBAddress::GetSymbolContext (uint32_t
// resolve_scope);
// lldb::SBSymbolContext SBTarget::ResolveSymbolContextForAddress (const

View File

@ -46,17 +46,17 @@ public:
bool RemoveListener(const lldb::SBListener &listener,
uint32_t event_mask = UINT32_MAX);
// This comparison is checking if the internal opaque pointer value
// is equal to that in "rhs".
// This comparison is checking if the internal opaque pointer value is equal
// to that in "rhs".
bool operator==(const lldb::SBBroadcaster &rhs) const;
// This comparison is checking if the internal opaque pointer value
// is not equal to that in "rhs".
// This comparison is checking if the internal opaque pointer value is not
// equal to that in "rhs".
bool operator!=(const lldb::SBBroadcaster &rhs) const;
// This comparison is checking if the internal opaque pointer value
// is less than that in "rhs" so SBBroadcaster objects can be contained
// in ordered containers.
// This comparison is checking if the internal opaque pointer value is less
// than that in "rhs" so SBBroadcaster objects can be contained in ordered
// containers.
bool operator<(const lldb::SBBroadcaster &rhs) const;
protected:

View File

@ -138,23 +138,20 @@ public:
lldb::SBCommandReturnObject result);
// The pointer based interface is not useful in SWIG, since the cursor &
// last_char arguments are string pointers INTO current_line
// and you can't do that in a scripting language interface in general...
// last_char arguments are string pointers INTO current_line and you can't do
// that in a scripting language interface in general...
// In either case, the way this works is that the you give it a line and
// cursor position in the line. The function
// will return the number of completions. The matches list will contain
// number_of_completions + 1 elements. The first
// element is the common substring after the cursor position for all the
// matches. The rest of the elements are the
// matches. The first element is useful if you are emulating the common shell
// behavior where the tab completes
// to the string that is common among all the matches, then you should first
// check if the first element is non-empty,
// cursor position in the line. The function will return the number of
// completions. The matches list will contain number_of_completions + 1
// elements. The first element is the common substring after the cursor
// position for all the matches. The rest of the elements are the matches.
// The first element is useful if you are emulating the common shell behavior
// where the tab completes to the string that is common among all the
// matches, then you should first check if the first element is non-empty,
// and if so just insert it and move the cursor to the end of the insertion.
// The next tab will return an empty
// common substring, and a list of choices (if any), at which point you should
// display the choices and let the user
// The next tab will return an empty common substring, and a list of choices
// (if any), at which point you should display the choices and let the user
// type further to disambiguate.
int HandleCompletion(const char *current_line, const char *cursor,
@ -167,9 +164,9 @@ public:
bool WasInterrupted() const;
// Catch commands before they execute by registering a callback that will
// get called when the command gets executed. This allows GUI or command
// line interfaces to intercept a command and stop it from happening
// Catch commands before they execute by registering a callback that will get
// called when the command gets executed. This allows GUI or command line
// interfaces to intercept a command and stop it from happening
bool SetCommandOverrideCallback(const char *command_name,
lldb::CommandOverrideCallback callback,
void *baton);

View File

@ -67,8 +67,7 @@ public:
bool GetDescription(lldb::SBStream &description);
// deprecated, these two functions do not take
// ownership of file handle
// deprecated, these two functions do not take ownership of file handle
void SetImmediateOutputFile(FILE *fh);
void SetImmediateErrorFile(FILE *fh);

View File

@ -71,11 +71,10 @@ public:
lldb::addr_t base_addr = LLDB_INVALID_ADDRESS);
// it would be nice to have SetData(SBError, const void*, size_t) when
// endianness and address size can be
// inferred from the existing DataExtractor, but having two SetData()
// signatures triggers a SWIG bug where
// the typemap isn't applied before resolving the overload, and thus the right
// function never gets called
// endianness and address size can be inferred from the existing
// DataExtractor, but having two SetData() signatures triggers a SWIG bug
// where the typemap isn't applied before resolving the overload, and thus
// the right function never gets called
void SetData(lldb::SBError &error, const void *buf, size_t size,
lldb::ByteOrder endian, uint8_t addr_size);
@ -87,9 +86,8 @@ public:
const char *data);
// in the following CreateData*() and SetData*() prototypes, the two
// parameters array and array_len
// should not be renamed or rearranged, because doing so will break the SWIG
// typemap
// parameters array and array_len should not be renamed or rearranged,
// because doing so will break the SWIG typemap
static lldb::SBData CreateDataFromUInt64Array(lldb::ByteOrder endian,
uint32_t addr_byte_size,
uint64_t *array,

View File

@ -51,10 +51,8 @@ public:
uint32_t GetOneThreadTimeoutInMicroSeconds() const;
// Set the timeout for running on one thread, 0 means use the default
// behavior.
// If you set this higher than the overall timeout, you'll get an error when
// you
// try to run the expression.
// behavior. If you set this higher than the overall timeout, you'll get an
// error when you try to run the expression.
void SetOneThreadTimeoutInMicroSeconds(uint32_t timeout = 0);
bool GetTryAllThreads() const;

View File

@ -153,10 +153,10 @@ public:
lldb::DynamicValueType use_dynamic);
// Find a value for a variable expression path like "rect.origin.x" or
// "pt_ptr->x", "*self", "*this->obj_ptr". The returned value is _not_
// and expression result and is not a constant object like
// SBFrame::EvaluateExpression(...) returns, but a child object of
// the variable value.
// "pt_ptr->x", "*self", "*this->obj_ptr". The returned value is _not_ and
// expression result and is not a constant object like
// SBFrame::EvaluateExpression(...) returns, but a child object of the
// variable value.
lldb::SBValue GetValueForVariablePath(const char *var_expr_cstr,
DynamicValueType use_dynamic);

View File

@ -16,8 +16,7 @@
#include <stdio.h>
// There's a lot to be fixed here, but need to wait for underlying insn
// implementation
// to be revised & settle down first.
// implementation to be revised & settle down first.
class InstructionImpl;

View File

@ -33,8 +33,8 @@ public:
lldb::SBInstruction GetInstructionAtIndex(uint32_t idx);
// ----------------------------------------------------------------------
// Returns the number of instructions between the start and end address.
// If canSetBreakpoint is true then the count will be the number of
// Returns the number of instructions between the start and end address. If
// canSetBreakpoint is true then the count will be the number of
// instructions on which a breakpoint can be set.
// ----------------------------------------------------------------------
size_t GetInstructionsCount(const SBAddress &start,

View File

@ -98,10 +98,10 @@ public:
lldb::SBThread GetSelectedThread() const;
//------------------------------------------------------------------
// Function for lazily creating a thread using the current OS
// plug-in. This function will be removed in the future when there
// are APIs to create SBThread objects through the interface and add
// them to the process through the SBProcess API.
// Function for lazily creating a thread using the current OS plug-in. This
// function will be removed in the future when there are APIs to create
// SBThread objects through the interface and add them to the process through
// the SBProcess API.
//------------------------------------------------------------------
lldb::SBThread CreateOSPluginThread(lldb::tid_t tid, lldb::addr_t context);

View File

@ -26,13 +26,12 @@ public:
bool IsValid() const;
// If this stream is not redirected to a file, it will maintain a local
// cache for the stream data which can be accessed using this accessor.
// If this stream is not redirected to a file, it will maintain a local cache
// for the stream data which can be accessed using this accessor.
const char *GetData();
// If this stream is not redirected to a file, it will maintain a local
// cache for the stream output whose length can be accessed using this
// accessor.
// If this stream is not redirected to a file, it will maintain a local cache
// for the stream output whose length can be accessed using this accessor.
size_t GetSize();
void Printf(const char *format, ...) __attribute__((format(printf, 2, 3)));
@ -44,8 +43,8 @@ public:
void RedirectToFileDescriptor(int fd, bool transfer_fh_ownership);
// If the stream is redirected to a file, forget about the file and if
// ownership of the file was transferred to this object, close the file.
// If the stream is backed by a local cache, clear this cache.
// ownership of the file was transferred to this object, close the file. If
// the stream is backed by a local cache, clear this cache.
void Clear();
protected:

View File

@ -55,8 +55,8 @@ public:
bool GetDescription(lldb::SBStream &description);
//----------------------------------------------------------------------
// Returns true if the symbol is externally visible in the module that
// it is defined in
// Returns true if the symbol is externally visible in the module that it is
// defined in
//----------------------------------------------------------------------
bool IsExternal();

View File

@ -775,8 +775,7 @@ public:
const void *buf, size_t size);
// The "WithFlavor" is necessary to keep SWIG from getting confused about
// overloaded arguments when
// using the buf + size -> Python Object magic.
// overloaded arguments when using the buf + size -> Python Object magic.
lldb::SBInstructionList GetInstructionsWithFlavor(lldb::SBAddress base_addr,
const char *flavor_string,
@ -829,8 +828,8 @@ protected:
friend class SBValue;
//------------------------------------------------------------------
// Constructors are private, use static Target::Create function to
// create an instance of this class.
// Constructors are private, use static Target::Create function to create an
// instance of this class.
//------------------------------------------------------------------
lldb::TargetSP GetSP() const;

View File

@ -134,8 +134,7 @@ public:
lldb::SBType type);
// this has no address! GetAddress() and GetLoadAddress() as well as
// AddressOf()
// on the return of this call all return invalid
// AddressOf() on the return of this call all return invalid
lldb::SBValue CreateValueFromData(const char *name, lldb::SBData data,
lldb::SBType type);

View File

@ -43,8 +43,8 @@ public:
const lldb::SBValueList &operator=(const lldb::SBValueList &rhs);
protected:
// only useful for visualizing the pointer or comparing two SBValueLists
// to see if they are backed by the same underlying Impl.
// only useful for visualizing the pointer or comparing two SBValueLists to
// see if they are backed by the same underlying Impl.
void *opaque_ptr();
private:

View File

@ -214,8 +214,8 @@ public:
void Dump(Stream *s) override;
//------------------------------------------------------------------
// The next set of methods provide ways to tell the breakpoint to update
// it's location list - usually done when modules appear or disappear.
// The next set of methods provide ways to tell the breakpoint to update it's
// location list - usually done when modules appear or disappear.
//------------------------------------------------------------------
//------------------------------------------------------------------
@ -287,8 +287,8 @@ public:
lldb::ModuleSP new_module_sp);
//------------------------------------------------------------------
// The next set of methods provide access to the breakpoint locations
// for this breakpoint.
// The next set of methods provide access to the breakpoint locations for
// this breakpoint.
//------------------------------------------------------------------
//------------------------------------------------------------------
@ -744,10 +744,10 @@ protected:
void DecrementIgnoreCount();
// BreakpointLocation::IgnoreCountShouldStop &
// Breakpoint::IgnoreCountShouldStop can only be called once per stop,
// and BreakpointLocation::IgnoreCountShouldStop should be tested first, and
// if it returns false we should
// continue, otherwise we should test Breakpoint::IgnoreCountShouldStop.
// Breakpoint::IgnoreCountShouldStop can only be called once per stop, and
// BreakpointLocation::IgnoreCountShouldStop should be tested first, and if
// it returns false we should continue, otherwise we should test
// Breakpoint::IgnoreCountShouldStop.
bool IgnoreCountShouldStop();
@ -760,8 +760,7 @@ protected:
private:
// This one should only be used by Target to copy breakpoints from target to
// target - primarily from the dummy
// target to prime new targets.
// target - primarily from the dummy target to prime new targets.
Breakpoint(Target &new_target, Breakpoint &bp_to_copy_from);
//------------------------------------------------------------------
@ -782,9 +781,9 @@ private:
BreakpointPreconditionSP m_precondition_sp; // The precondition is a
// breakpoint-level hit filter
// that can be used
// to skip certain breakpoint hits. For instance, exception breakpoints
// use this to limit the stop to certain exception classes, while leaving
// the condition & callback free for user specification.
// to skip certain breakpoint hits. For instance, exception breakpoints use
// this to limit the stop to certain exception classes, while leaving the
// condition & callback free for user specification.
std::unique_ptr<BreakpointOptions>
m_options_up; // Settable breakpoint options
BreakpointLocationList

View File

@ -384,8 +384,7 @@ private:
//------------------------------------------------------------------
// Constructors and Destructors
//
// Only the Breakpoint can make breakpoint locations, and it owns
// them.
// Only the Breakpoint can make breakpoint locations, and it owns them.
//------------------------------------------------------------------
//------------------------------------------------------------------

View File

@ -178,8 +178,8 @@ public:
protected:
//------------------------------------------------------------------
// Classes that inherit from BreakpointLocationCollection can see
// and modify these
// Classes that inherit from BreakpointLocationCollection can see and modify
// these
//------------------------------------------------------------------
private:

View File

@ -34,13 +34,11 @@ namespace lldb_private {
//----------------------------------------------------------------------
class BreakpointLocationList {
// Only Breakpoints can make the location list, or add elements to it.
// This is not just some random collection of locations. Rather, the act of
// adding the location
// to this list sets its ID, and implicitly all the locations have the same
// breakpoint ID as
// well. If you need a generic container for breakpoint locations, use
// BreakpointLocationCollection.
// Only Breakpoints can make the location list, or add elements to it. This
// is not just some random collection of locations. Rather, the act of
// adding the location to this list sets its ID, and implicitly all the
// locations have the same breakpoint ID as well. If you need a generic
// container for breakpoint locations, use BreakpointLocationCollection.
friend class Breakpoint;
public:

View File

@ -80,8 +80,8 @@ public:
*this = Permissions();
}
// Merge the permissions from incoming into this set of permissions.
// Only merge set permissions, and most restrictive permission wins.
// Merge the permissions from incoming into this set of permissions. Only
// merge set permissions, and most restrictive permission wins.
void MergeInto(const Permissions &incoming)
{
MergePermission(incoming, listPerm);

View File

@ -156,18 +156,16 @@ public:
// Callbacks
//
// Breakpoint callbacks come in two forms, synchronous and asynchronous.
// Synchronous callbacks will get
// run before any of the thread plans are consulted, and if they return false
// the target will continue
// "under the radar" of the thread plans. There are a couple of restrictions
// to synchronous callbacks:
// 1) They should NOT resume the target themselves. Just return false if you
// want the target to restart.
// 2) Breakpoints with synchronous callbacks can't have conditions (or rather,
// they can have them, but they
// won't do anything. Ditto with ignore counts, etc... You are supposed
// to control that all through the
// callback.
// Synchronous callbacks will get run before any of the thread plans are
// consulted, and if they return false the target will continue "under the
// radar" of the thread plans. There are a couple of restrictions to
// synchronous callbacks:
// 1) They should NOT resume the target themselves.
// Just return false if you want the target to restart.
// 2) Breakpoints with synchronous callbacks can't have conditions
// (or rather, they can have them, but they won't do anything.
// Ditto with ignore counts, etc... You are supposed to control that all
// through the callback.
// Asynchronous callbacks get run as part of the "ShouldStop" logic in the
// thread plan. The logic there is:
// a) If the breakpoint is thread specific and not for this thread, continue
@ -181,12 +179,10 @@ public:
// b) If the ignore count says we shouldn't stop, then ditto.
// c) If the condition says we shouldn't stop, then ditto.
// d) Otherwise, the callback will get run, and if it returns true we will
// stop, and if false we won't.
// stop, and if false we won't.
// The asynchronous callback can run the target itself, but at present that
// should be the last action the
// callback does. We will relax this condition at some point, but it will
// take a bit of plumbing to get
// that to work.
// should be the last action the callback does. We will relax this condition
// at some point, but it will take a bit of plumbing to get that to work.
//
//------------------------------------------------------------------
@ -227,8 +223,8 @@ public:
//------------------------------------------------------------------
void ClearCallback();
// The rest of these functions are meant to be used only within the breakpoint
// handling mechanism.
// The rest of these functions are meant to be used only within the
// breakpoint handling mechanism.
//------------------------------------------------------------------
/// Use this function to invoke the callback for a specific stop.

View File

@ -171,8 +171,8 @@ public:
UnknownResolver
};
// Translate the Ty to name for serialization,
// the "+2" is one for size vrs. index, and one for UnknownResolver.
// Translate the Ty to name for serialization, the "+2" is one for size vrs.
// index, and one for UnknownResolver.
static const char *g_ty_to_name[LastKnownResolverType + 2];
//------------------------------------------------------------------
@ -199,8 +199,8 @@ public:
protected:
// Used for serializing resolver options:
// The options in this enum and the strings in the
// g_option_names must be kept in sync.
// The options in this enum and the strings in the g_option_names must be
// kept in sync.
enum class OptionNames : uint32_t {
AddressOffset = 0,
ExactMatch,

View File

@ -74,8 +74,7 @@ protected:
FileSpec m_module_filespec; // If this filespec is Valid, and m_addr is an
// offset, then it will be converted
// to a Section+Offset address in this module, whenever that module gets
// around to
// being loaded.
// around to being loaded.
private:
DISALLOW_COPY_AND_ASSIGN(BreakpointResolverAddress);
};

View File

@ -48,8 +48,8 @@ public:
uint32_t name_type_mask, lldb::LanguageType language,
lldb::addr_t offset, bool skip_prologue);
// Creates a function breakpoint by regular expression. Takes over control of
// the lifespan of func_regex.
// Creates a function breakpoint by regular expression. Takes over control
// of the lifespan of func_regex.
BreakpointResolverName(Breakpoint *bkpt, RegularExpression &func_regex,
lldb::LanguageType language, lldb::addr_t offset,
bool skip_prologue);

View File

@ -241,9 +241,9 @@ public:
private:
friend class Process;
friend class BreakpointLocation;
// The StopInfoBreakpoint knows when it is processing a hit for a thread for a
// site, so let it be the
// one to manage setting the location hit count once and only once.
// The StopInfoBreakpoint knows when it is processing a hit for a thread for
// a site, so let it be the one to manage setting the location hit count once
// and only once.
friend class StopInfoBreakpoint;
void BumpHitCounts();
@ -264,8 +264,8 @@ private:
bool
m_enabled; ///< Boolean indicating if this breakpoint site enabled or not.
// Consider adding an optimization where if there is only one
// owner, we don't store a list. The usual case will be only one owner...
// Consider adding an optimization where if there is only one owner, we don't
// store a list. The usual case will be only one owner...
BreakpointLocationCollection m_owners; ///< This has the BreakpointLocations
///that share this breakpoint site.
std::recursive_mutex

View File

@ -77,8 +77,8 @@ protected:
// breakpoint/watchpoint
uint32_t m_byte_size; // The size in bytes of stop location. e.g. the length
// of the trap opcode for
// software breakpoints, or the optional length in bytes for
// hardware breakpoints, or the length of the watchpoint.
// software breakpoints, or the optional length in bytes for hardware
// breakpoints, or the length of the watchpoint.
uint32_t
m_hit_count; // Number of times this breakpoint/watchpoint has been hit

View File

@ -71,9 +71,9 @@ public:
bool IsEnabled() const;
// This doesn't really enable/disable the watchpoint.
// It is currently just for use in the Process plugin's
// {Enable,Disable}Watchpoint, which should be used instead.
// This doesn't really enable/disable the watchpoint. It is currently just
// for use in the Process plugin's {Enable,Disable}Watchpoint, which should
// be used instead.
void SetEnabled(bool enabled, bool notify = true);
@ -197,10 +197,8 @@ private:
uint32_t m_disabled_count; // Keep track of the count that the watchpoint is
// disabled while in ephemeral mode.
// At the end of the ephemeral mode when the watchpoint is to be enabled
// again,
// we check the count, if it is more than 1, it means the user-supplied
// actions
// actually want the watchpoint to be disabled!
// again, we check the count, if it is more than 1, it means the user-
// supplied actions actually want the watchpoint to be disabled!
uint32_t m_watch_read : 1, // 1 if we stop when the watched data is read from
m_watch_write : 1, // 1 if we stop when the watched data is written to
m_watch_was_read : 1, // Set to 1 when watchpoint is hit for a read access

View File

@ -31,9 +31,9 @@ namespace lldb_private {
//----------------------------------------------------------------------
class WatchpointList {
// Only Target can make the watchpoint list, or add elements to it.
// This is not just some random collection of watchpoints. Rather, the act of
// adding the watchpoint to this list sets its ID.
// Only Target can make the watchpoint list, or add elements to it. This is
// not just some random collection of watchpoints. Rather, the act of adding
// the watchpoint to this list sets its ID.
friend class Watchpoint;
friend class Target;

View File

@ -69,15 +69,13 @@ public:
// Callbacks
//
// Watchpoint callbacks come in two forms, synchronous and asynchronous.
// Synchronous callbacks will get
// run before any of the thread plans are consulted, and if they return false
// the target will continue
// "under the radar" of the thread plans. There are a couple of restrictions
// to synchronous callbacks:
// 1) They should NOT resume the target themselves. Just return false if you
// want the target to restart.
// 2) Watchpoints with synchronous callbacks can't have conditions (or rather,
// they can have them, but they
// Synchronous callbacks will get run before any of the thread plans are
// consulted, and if they return false the target will continue "under the
// radar" of the thread plans. There are a couple of restrictions to
// synchronous callbacks: 1) They should NOT resume the target themselves.
// Just return false if you want the target to restart. 2) Watchpoints with
// synchronous callbacks can't have conditions (or rather, they can have
// them, but they
// won't do anything. Ditto with ignore counts, etc... You are supposed
// to control that all through the
// callback.
@ -118,8 +116,8 @@ public:
//------------------------------------------------------------------
void ClearCallback();
// The rest of these functions are meant to be used only within the watchpoint
// handling mechanism.
// The rest of these functions are meant to be used only within the
// watchpoint handling mechanism.
//------------------------------------------------------------------
/// Use this function to invoke the callback for a specific stop.

View File

@ -531,11 +531,11 @@ public:
bool CalculateSymbolContextLineEntry(LineEntry &line_entry) const;
//------------------------------------------------------------------
// Returns true if the section should be valid, but isn't because
// the shared pointer to the section can't be reconstructed from
// a weak pointer that contains a valid weak reference to a section.
// Returns false if the section weak pointer has no reference to
// a section, or if the section is still valid
// Returns true if the section should be valid, but isn't because the shared
// pointer to the section can't be reconstructed from a weak pointer that
// contains a valid weak reference to a section. Returns false if the section
// weak pointer has no reference to a section, or if the section is still
// valid
//------------------------------------------------------------------
bool SectionWasDeleted() const;
@ -547,29 +547,27 @@ protected:
lldb::addr_t m_offset; ///< Offset into section if \a m_section_wp is valid...
//------------------------------------------------------------------
// Returns true if the m_section_wp once had a reference to a valid
// section shared pointer, but no longer does. This can happen if
// we have an address from a module that gets unloaded and deleted.
// This function should only be called if GetSection() returns an
// empty shared pointer and you want to know if this address used to
// have a valid section.
// Returns true if the m_section_wp once had a reference to a valid section
// shared pointer, but no longer does. This can happen if we have an address
// from a module that gets unloaded and deleted. This function should only be
// called if GetSection() returns an empty shared pointer and you want to
// know if this address used to have a valid section.
//------------------------------------------------------------------
bool SectionWasDeletedPrivate() const;
};
//----------------------------------------------------------------------
// NOTE: Be careful using this operator. It can correctly compare two
// addresses from the same Module correctly. It can't compare two
// addresses from different modules in any meaningful way, but it will
// compare the module pointers.
// addresses from the same Module correctly. It can't compare two addresses
// from different modules in any meaningful way, but it will compare the module
// pointers.
//
// To sum things up:
// - works great for addresses within the same module
// - it works for addresses across multiple modules, but don't expect the
// - works great for addresses within the same module - it works for addresses
// across multiple modules, but don't expect the
// address results to make much sense
//
// This basically lets Address objects be used in ordered collection
// classes.
// This basically lets Address objects be used in ordered collection classes.
//----------------------------------------------------------------------
bool operator<(const Address &lhs, const Address &rhs);
bool operator>(const Address &lhs, const Address &rhs);

View File

@ -261,8 +261,8 @@ public:
/// The number of bytes that this object occupies in memory.
//------------------------------------------------------------------
size_t MemorySize() const {
// Noting special for the memory size of a single AddressRange object,
// it is just the size of itself.
// Noting special for the memory size of a single AddressRange object, it
// is just the size of itself.
return sizeof(AddressRange);
}

View File

@ -41,8 +41,8 @@ public:
AddressResolverName(const char *func_name,
AddressResolver::MatchType type = Exact);
// Creates a function breakpoint by regular expression. Takes over control of
// the lifespan of func_regex.
// Creates a function breakpoint by regular expression. Takes over control
// of the lifespan of func_regex.
AddressResolverName(RegularExpression &func_regex);
AddressResolverName(const char *class_name, const char *method,

View File

@ -59,10 +59,9 @@ public:
uint32_t GetEventBits() const { return m_event_bits; }
// Tell whether this BroadcastEventSpec is contained in in_spec.
// That is:
// (a) the two spec's share the same broadcaster class
// (b) the event bits of this spec are wholly contained in those of in_spec.
// Tell whether this BroadcastEventSpec is contained in in_spec. That is: (a)
// the two spec's share the same broadcaster class (b) the event bits of this
// spec are wholly contained in those of in_spec.
bool IsContainedIn(BroadcastEventSpec in_spec) const {
if (m_broadcaster_class != in_spec.GetBroadcasterClass())
return false;
@ -454,8 +453,7 @@ public:
void RestoreBroadcaster() { m_broadcaster_sp->RestoreBroadcaster(); }
// This needs to be filled in if you are going to register the broadcaster
// with the broadcaster
// manager and do broadcaster class matching.
// with the broadcaster manager and do broadcaster class matching.
// FIXME: Probably should make a ManagedBroadcaster subclass with all the bits
// needed to work
// with the BroadcasterManager, so that it is clearer how to add one.
@ -465,21 +463,17 @@ public:
protected:
// BroadcasterImpl contains the actual Broadcaster implementation. The
// Broadcaster makes a BroadcasterImpl
// which lives as long as it does. The Listeners & the Events hold a weak
// pointer to the BroadcasterImpl,
// so that they can survive if a Broadcaster they were listening to is
// destroyed w/o their being able to
// unregister from it (which can happen if the Broadcasters & Listeners are
// being destroyed on separate threads
// simultaneously.
// The Broadcaster itself can't be shared out as a weak pointer, because some
// things that are broadcasters
// (e.g. the Target and the Process) are shared in their own right.
// Broadcaster makes a BroadcasterImpl which lives as long as it does. The
// Listeners & the Events hold a weak pointer to the BroadcasterImpl, so that
// they can survive if a Broadcaster they were listening to is destroyed w/o
// their being able to unregister from it (which can happen if the
// Broadcasters & Listeners are being destroyed on separate threads
// simultaneously. The Broadcaster itself can't be shared out as a weak
// pointer, because some things that are broadcasters (e.g. the Target and
// the Process) are shared in their own right.
//
// For the most part, the Broadcaster functions dispatch to the
// BroadcasterImpl, and are documented in the
// public Broadcaster API above.
// BroadcasterImpl, and are documented in the public Broadcaster API above.
class BroadcasterImpl {
friend class Listener;

View File

@ -156,11 +156,9 @@ public:
lldb::ListenerSP GetListener() { return m_listener_sp; }
// This returns the Debugger's scratch source manager. It won't be able to
// look up files in debug
// information, but it can look up files by absolute path and display them to
// you.
// To get the target's source manager, call GetSourceManager on the target
// instead.
// look up files in debug information, but it can look up files by absolute
// path and display them to you. To get the target's source manager, call
// GetSourceManager on the target instead.
SourceManager &GetSourceManager();
lldb::TargetSP GetSelectedTarget() {
@ -188,9 +186,8 @@ public:
void DispatchInputEndOfFile();
//------------------------------------------------------------------
// If any of the streams are not set, set them to the in/out/err
// stream of the top most input reader to ensure they at least have
// something
// If any of the streams are not set, set them to the in/out/err stream of
// the top most input reader to ensure they at least have something
//------------------------------------------------------------------
void AdoptTopIOHandlerFilesIfInvalid(lldb::StreamFileSP &in,
lldb::StreamFileSP &out,
@ -323,9 +320,8 @@ public:
Status RunREPL(lldb::LanguageType language, const char *repl_options);
// This is for use in the command interpreter, when you either want the
// selected target, or if no target
// is present you want to prime the dummy target with entities that will be
// copied over to new targets.
// selected target, or if no target is present you want to prime the dummy
// target with entities that will be copied over to new targets.
Target *GetSelectedOrDummyTarget(bool prefer_dummy = false);
Target *GetDummyTarget();
@ -378,8 +374,8 @@ protected:
lldb::BroadcasterManagerSP m_broadcaster_manager_sp; // The debugger acts as a
// broadcaster manager of
// last resort.
// It needs to get constructed before the target_list or any other
// member that might want to broadcast through the debugger.
// It needs to get constructed before the target_list or any other member
// that might want to broadcast through the debugger.
TerminalState m_terminal_state;
TargetList m_target_list;
@ -418,8 +414,8 @@ protected:
};
private:
// Use Debugger::CreateInstance() to get a shared pointer to a new
// debugger object
// Use Debugger::CreateInstance() to get a shared pointer to a new debugger
// object
Debugger(lldb::LogOutputCallback m_log_callback, void *baton);
DISALLOW_COPY_AND_ASSIGN(Debugger);

View File

@ -105,8 +105,7 @@ public:
lldb::AddressClass GetAddressClass();
void SetAddress(const Address &addr) {
// Invalidate the address class to lazily discover
// it if we need to.
// Invalidate the address class to lazily discover it if we need to.
m_address_class = lldb::eAddressClassInvalid;
m_address = addr;
}
@ -235,11 +234,12 @@ public:
protected:
Address m_address; // The section offset address of this instruction
// We include an address class in the Instruction class to
// allow the instruction specify the eAddressClassCodeAlternateISA
// (currently used for thumb), and also to specify data (eAddressClassData).
// The usual value will be eAddressClassCode, but often when
// disassembling memory, you might run into data. This can
// help us to disassemble appropriately.
// allow the instruction specify the
// eAddressClassCodeAlternateISA (currently used for
// thumb), and also to specify data (eAddressClassData).
// The usual value will be eAddressClassCode, but often
// when disassembling memory, you might run into data.
// This can help us to disassemble appropriately.
private:
lldb::AddressClass
m_address_class; // Use GetAddressClass () accessor function!
@ -365,12 +365,10 @@ public:
};
// FindPlugin should be lax about the flavor string (it is too annoying to
// have various internal uses of the
// disassembler fail because the global flavor string gets set wrong.
// Instead, if you get a flavor string you
// have various internal uses of the disassembler fail because the global
// flavor string gets set wrong. Instead, if you get a flavor string you
// don't understand, use the default. Folks who care to check can use the
// FlavorValidForArchSpec method on the
// disassembler they got back.
// FlavorValidForArchSpec method on the disassembler they got back.
static lldb::DisassemblerSP
FindPlugin(const ArchSpec &arch, const char *flavor, const char *plugin_name);
@ -470,8 +468,8 @@ public:
const char *flavor) = 0;
protected:
// SourceLine and SourceLinesToDisplay structures are only used in
// the mixed source and assembly display methods internal to this class.
// SourceLine and SourceLinesToDisplay structures are only used in the mixed
// source and assembly display methods internal to this class.
struct SourceLine {
FileSpec file;
@ -494,9 +492,9 @@ protected:
struct SourceLinesToDisplay {
std::vector<SourceLine> lines;
// index of the "current" source line, if we want to highlight that
// when displaying the source lines. (as opposed to the surrounding
// source lines provided to give context)
// index of the "current" source line, if we want to highlight that when
// displaying the source lines. (as opposed to the surrounding source
// lines provided to give context)
size_t current_source_line;
// Whether to print a blank line at the end of the source lines.
@ -507,8 +505,8 @@ protected:
}
};
// Get the function's declaration line number, hopefully a line number earlier
// than the opening curly brace at the start of the function body.
// Get the function's declaration line number, hopefully a line number
// earlier than the opening curly brace at the start of the function body.
static SourceLine GetFunctionDeclLineEntry(const SymbolContext &sc);
// Add the provided SourceLine to the map of filenames-to-source-lines-seen.
@ -517,14 +515,13 @@ protected:
std::map<FileSpec, std::set<uint32_t>> &source_lines_seen);
// Given a source line, determine if we should print it when we're doing
// mixed source & assembly output.
// We're currently using the target.process.thread.step-avoid-regexp setting
// (which is used for stepping over inlined STL functions by default) to
// determine what source lines to avoid showing.
// mixed source & assembly output. We're currently using the
// target.process.thread.step-avoid-regexp setting (which is used for
// stepping over inlined STL functions by default) to determine what source
// lines to avoid showing.
//
// Returns true if this source line should be elided (if the source line
// should
// not be displayed).
// should not be displayed).
static bool
ElideMixedSourceAndDisassemblyLine(const ExecutionContext &exe_ctx,
const SymbolContext &sc, SourceLine &line);

View File

@ -125,8 +125,8 @@ public:
// prologue
eContextPushRegisterOnStack,
// Exclusively used when restoring a register off the stack as part of
// the epilogue
// Exclusively used when restoring a register off the stack as part of the
// epilogue
eContextPopRegisterOffStack,
// Add or subtract a value from the stack
@ -135,8 +135,8 @@ public:
// Adjust the frame pointer for the current frame
eContextSetFramePointer,
// Typically in an epilogue sequence. Copy the frame pointer back
// into the stack pointer, use SP for CFA calculations again.
// Typically in an epilogue sequence. Copy the frame pointer back into the
// stack pointer, use SP for CFA calculations again.
eContextRestoreStackPointer,
// Add or subtract a value from a base address register (other than SP)
@ -159,8 +159,8 @@ public:
// Used when performing an absolute branch where the
eContextAbsoluteBranchRegister,
// Used when performing a supervisor call to an operating system to
// provide a service:
// Used when performing a supervisor call to an operating system to provide
// a service:
eContextSupervisorCall,
// Used when performing a MemU operation to read the PC-relative offset
@ -360,9 +360,8 @@ public:
const RegisterValue &reg_value);
// Type to represent the condition of an instruction. The UINT32 value is
// reserved for the
// unconditional case and all other value can be used in an architecture
// dependent way.
// reserved for the unconditional case and all other value can be used in an
// architecture dependent way.
typedef uint32_t InstructionCondition;
static const InstructionCondition UnconditionalCondition = UINT32_MAX;

View File

@ -218,10 +218,10 @@ public:
//----------------------------------------------------------------------
// Format the current elements into the stream \a s.
//
// The root element will be stripped off and the format str passed in
// will be either an empty string (print a description of this object),
// or contain a . separated series like a domain name that identifies
// further sub elements to display.
// The root element will be stripped off and the format str passed in will be
// either an empty string (print a description of this object), or contain a
// `.`-separated series like a domain name that identifies further
// sub-elements to display.
//----------------------------------------------------------------------
static bool FormatFileSpec(const FileSpec &file, Stream &s,
llvm::StringRef elements,

View File

@ -63,14 +63,13 @@ public:
virtual ~IOHandler();
// Each IOHandler gets to run until it is done. It should read data
// from the "in" and place output into "out" and "err and return
// when done.
// Each IOHandler gets to run until it is done. It should read data from the
// "in" and place output into "out" and "err and return when done.
virtual void Run() = 0;
// Called when an input reader should relinquish its control so another
// can be pushed onto the IO handler stack, or so the current IO
// handler can pop itself off the stack
// Called when an input reader should relinquish its control so another can
// be pushed onto the IO handler stack, or so the current IO handler can pop
// itself off the stack
virtual void Cancel() = 0;
@ -273,8 +272,8 @@ public:
//------------------------------------------------------------------
virtual bool IOHandlerIsInputComplete(IOHandler &io_handler,
StringList &lines) {
// Impose no requirements for input to be considered
// complete. subclasses should do something more intelligent.
// Impose no requirements for input to be considered complete. subclasses
// should do something more intelligent.
return true;
}
@ -289,8 +288,8 @@ public:
//------------------------------------------------------------------
// Intercept the IOHandler::Interrupt() calls and do something.
//
// Return true if the interrupt was handled, false if the IOHandler
// should continue to try handle the interrupt itself.
// Return true if the interrupt was handled, false if the IOHandler should
// continue to try handle the interrupt itself.
//------------------------------------------------------------------
virtual bool IOHandlerInterrupt(IOHandler &io_handler) { return false; }
@ -302,8 +301,7 @@ protected:
// IOHandlerDelegateMultiline
//
// A IOHandlerDelegate that handles terminating multi-line input when
// the last line is equal to "end_line" which is specified in the
// constructor.
// the last line is equal to "end_line" which is specified in the constructor.
//----------------------------------------------------------------------
class IOHandlerDelegateMultiline : public IOHandlerDelegate {
public:
@ -325,9 +323,8 @@ public:
// Determine whether the end of input signal has been entered
const size_t num_lines = lines.GetSize();
if (num_lines > 0 && lines[num_lines - 1] == m_end_line) {
// Remove the terminal line from "lines" so it doesn't appear in
// the resulting input and return true to indicate we are done
// getting lines
// Remove the terminal line from "lines" so it doesn't appear in the
// resulting input and return true to indicate we are done getting lines
lines.PopBack();
return true;
}
@ -454,8 +451,7 @@ protected:
};
// The order of base classes is important. Look at the constructor of
// IOHandlerConfirm
// to see how.
// IOHandlerConfirm to see how.
class IOHandlerConfirm : public IOHandlerDelegate, public IOHandlerEditline {
public:
IOHandlerConfirm(Debugger &debugger, llvm::StringRef prompt,

View File

@ -256,13 +256,12 @@ public:
return false;
}
// This method must be implemented in any subclasses.
// The KeyType is user specified and must somehow result in a string
// value. For example, the KeyType might be a string offset in a string
// table and subclasses can store their string table as a member of the
// subclass and return a valie "const char *" given a "key". The value
// could also be a C string pointer, in which case just returning "key"
// will suffice.
// This method must be implemented in any subclasses. The KeyType is user
// specified and must somehow result in a string value. For example, the
// KeyType might be a string offset in a string table and subclasses can
// store their string table as a member of the subclass and return a valie
// "const char *" given a "key". The value could also be a C string
// pointer, in which case just returning "key" will suffice.
virtual const char *GetStringForKeyType(KeyType key) const = 0;
virtual bool ReadHashData(uint32_t hash_data_offset,
@ -270,19 +269,18 @@ public:
// This method must be implemented in any subclasses and it must try to
// read one "Pair" at the offset pointed to by the "hash_data_offset_ptr"
// parameter. This offset should be updated as bytes are consumed and
// a value "Result" enum should be returned. If the "name" matches the
// full name for the "pair.key" (which must be filled in by this call),
// then the HashData in the pair ("pair.value") should be extracted and
// filled in and "eResultKeyMatch" should be returned. If "name" doesn't
// match this string for the key, then "eResultKeyMismatch" should be
// returned and all data for the current HashData must be consumed or
// skipped and the "hash_data_offset_ptr" offset needs to be updated to
// point to the next HashData. If the end of the HashData objects for
// a given hash value have been reached, then "eResultEndOfHashData"
// should be returned. If anything else goes wrong during parsing,
// return "eResultError" and the corresponding "Find()" function will
// be canceled and return false.
// parameter. This offset should be updated as bytes are consumed and a
// value "Result" enum should be returned. If the "name" matches the full
// name for the "pair.key" (which must be filled in by this call), then the
// HashData in the pair ("pair.value") should be extracted and filled in
// and "eResultKeyMatch" should be returned. If "name" doesn't match this
// string for the key, then "eResultKeyMismatch" should be returned and all
// data for the current HashData must be consumed or skipped and the
// "hash_data_offset_ptr" offset needs to be updated to point to the next
// HashData. If the end of the HashData objects for a given hash value have
// been reached, then "eResultEndOfHashData" should be returned. If
// anything else goes wrong during parsing, return "eResultError" and the
// corresponding "Find()" function will be canceled and return false.
virtual Result GetHashDataForName(llvm::StringRef name,
lldb::offset_t *hash_data_offset_ptr,
Pair &pair) const = 0;

View File

@ -113,13 +113,12 @@ namespace lldb_private {
class Module : public std::enable_shared_from_this<Module>,
public SymbolContextScope {
public:
// Static functions that can track the lifetime of module objects.
// This is handy because we might have Module objects that are in
// shared pointers that aren't in the global module list (from
// ModuleList). If this is the case we need to know about it.
// The modules in the global list maintained by these functions
// can be viewed using the "target modules list" command using the
// "--global" (-g for short).
// Static functions that can track the lifetime of module objects. This is
// handy because we might have Module objects that are in shared pointers
// that aren't in the global module list (from ModuleList). If this is the
// case we need to know about it. The modules in the global list maintained
// by these functions can be viewed using the "target modules list" command
// using the "--global" (-g for short).
static size_t GetNumberAllocatedModules();
static Module *GetAllocatedModuleAtIndex(size_t idx);
@ -936,12 +935,10 @@ public:
TypeSystem *GetTypeSystemForLanguage(lldb::LanguageType language);
// Special error functions that can do printf style formatting that will
// prepend the message with
// something appropriate for this module (like the architecture, path and
// object name (if any)).
// This centralizes code so that everyone doesn't need to format their error
// and log messages on
// their own and keeps the output a bit more consistent.
// prepend the message with something appropriate for this module (like the
// architecture, path and object name (if any)). This centralizes code so
// that everyone doesn't need to format their error and log messages on their
// own and keeps the output a bit more consistent.
void LogMessage(Log *log, const char *format, ...)
__attribute__((format(printf, 3, 4)));
@ -960,15 +957,15 @@ public:
__attribute__((format(printf, 2, 3)));
//------------------------------------------------------------------
// Return true if the file backing this module has changed since the
// module was originally created since we saved the initial file
// modification time when the module first gets created.
// Return true if the file backing this module has changed since the module
// was originally created since we saved the initial file modification time
// when the module first gets created.
//------------------------------------------------------------------
bool FileHasChanged() const;
//------------------------------------------------------------------
// SymbolVendor, SymbolFile and ObjectFile member objects should
// lock the module mutex to avoid deadlocks.
// SymbolVendor, SymbolFile and ObjectFile member objects should lock the
// module mutex to avoid deadlocks.
//------------------------------------------------------------------
std::recursive_mutex &GetMutex() const { return m_mutex; }

View File

@ -410,9 +410,9 @@ public:
//------------------------------------------------------------------
// Find a module by UUID
//
// The UUID value for a module is extracted from the ObjectFile and
// is the MD5 checksum, or a smarter object file equivalent, so
// finding modules by UUID values is very efficient and accurate.
// The UUID value for a module is extracted from the ObjectFile and is the
// MD5 checksum, or a smarter object file equivalent, so finding modules by
// UUID values is very efficient and accurate.
//------------------------------------------------------------------
lldb::ModuleSP FindModule(const UUID &uuid) const;

View File

@ -341,8 +341,8 @@ public:
m_specs.insert(m_specs.end(), rhs.m_specs.begin(), rhs.m_specs.end());
}
// The index "i" must be valid and this can't be used in
// multi-threaded code as no mutex lock is taken.
// The index "i" must be valid and this can't be used in multi-threaded code
// as no mutex lock is taken.
ModuleSpec &GetModuleSpecRefAtIndex(size_t i) { return m_specs[i]; }
bool GetModuleSpecAtIndex(size_t i, ModuleSpec &module_spec) const {

View File

@ -477,11 +477,11 @@ public:
const ConstString &name);
//------------------------------------------------------------------
// Some plug-ins might register a DebuggerInitializeCallback
// callback when registering the plug-in. After a new Debugger
// instance is created, this DebuggerInitialize function will get
// called. This allows plug-ins to install Properties and do any
// other initialization that requires a debugger instance.
// Some plug-ins might register a DebuggerInitializeCallback callback when
// registering the plug-in. After a new Debugger instance is created, this
// DebuggerInitialize function will get called. This allows plug-ins to
// install Properties and do any other initialization that requires a
// debugger instance.
//------------------------------------------------------------------
static void DebuggerInitialize(Debugger &debugger);

View File

@ -27,9 +27,8 @@
namespace lldb_private {
//----------------------------------------------------------------------
// Templatized classes for dealing with generic ranges and also
// collections of ranges, or collections of ranges that have associated
// data.
// Templatized classes for dealing with generic ranges and also collections of
// ranges, or collections of ranges that have associated data.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
@ -214,8 +213,8 @@ public:
else
minimal_ranges.push_back(*pos);
}
// Use the swap technique in case our new vector is much smaller.
// We must swap when using the STL because std::vector objects never
// Use the swap technique in case our new vector is much smaller. We
// must swap when using the STL because std::vector objects never
// release or reduce the memory once it has been allocated/reserved.
m_entries.swap(minimal_ranges);
}
@ -228,8 +227,8 @@ public:
#endif
if (m_entries.empty())
return fail_value;
// m_entries must be sorted, so if we aren't empty, we grab the
// first range's base
// m_entries must be sorted, so if we aren't empty, we grab the first
// range's base
return m_entries.front().GetRangeBase();
}
@ -239,8 +238,8 @@ public:
#endif
if (m_entries.empty())
return fail_value;
// m_entries must be sorted, so if we aren't empty, we grab the
// last range's end
// m_entries must be sorted, so if we aren't empty, we grab the last
// range's end
return m_entries.back().GetRangeEnd();
}
@ -446,8 +445,8 @@ public:
else
minimal_ranges.push_back(*pos);
}
// Use the swap technique in case our new vector is much smaller.
// We must swap when using the STL because std::vector objects never
// Use the swap technique in case our new vector is much smaller. We
// must swap when using the STL because std::vector objects never
// release or reduce the memory once it has been allocated/reserved.
m_entries.swap(minimal_ranges);
}
@ -460,8 +459,8 @@ public:
#endif
if (m_entries.empty())
return fail_value;
// m_entries must be sorted, so if we aren't empty, we grab the
// first range's base
// m_entries must be sorted, so if we aren't empty, we grab the first
// range's base
return m_entries.front().GetRangeBase();
}
@ -471,8 +470,8 @@ public:
#endif
if (m_entries.empty())
return fail_value;
// m_entries must be sorted, so if we aren't empty, we grab the
// last range's end
// m_entries must be sorted, so if we aren't empty, we grab the last
// range's end
return m_entries.back().GetRangeEnd();
}
@ -604,8 +603,8 @@ protected:
//----------------------------------------------------------------------
// A simple range with data class where you get to define the type of
// the range base "B", the type used for the range byte size "S", and
// the type for the associated data "T".
// the range base "B", the type used for the range byte size "S", and the type
// for the associated data "T".
//----------------------------------------------------------------------
template <typename B, typename S, typename T>
struct RangeData : public Range<B, S> {
@ -688,8 +687,8 @@ public:
}
}
// We we can combine at least one entry, then we make a new collection
// and populate it accordingly, and then swap it into place.
// We we can combine at least one entry, then we make a new collection and
// populate it accordingly, and then swap it into place.
if (can_combine) {
Collection minimal_ranges;
for (pos = m_entries.begin(), end = m_entries.end(), prev = end;
@ -699,9 +698,9 @@ public:
else
minimal_ranges.push_back(*pos);
}
// Use the swap technique in case our new vector is much smaller.
// We must swap when using the STL because std::vector objects never
// release or reduce the memory once it has been allocated/reserved.
// Use the swap technique in case our new vector is much smaller. We must
// swap when using the STL because std::vector objects never release or
// reduce the memory once it has been allocated/reserved.
m_entries.swap(minimal_ranges);
}
}
@ -828,8 +827,8 @@ protected:
Collection m_entries;
};
// Same as RangeDataArray, but uses std::vector as to not
// require static storage of N items in the class itself
// Same as RangeDataArray, but uses std::vector as to not require static
// storage of N items in the class itself
template <typename B, typename S, typename T> class RangeDataVector {
public:
typedef RangeData<B, S, T> Entry;
@ -878,8 +877,8 @@ public:
}
}
// We we can combine at least one entry, then we make a new collection
// and populate it accordingly, and then swap it into place.
// We we can combine at least one entry, then we make a new collection and
// populate it accordingly, and then swap it into place.
if (can_combine) {
Collection minimal_ranges;
for (pos = m_entries.begin(), end = m_entries.end(), prev = end;
@ -889,15 +888,15 @@ public:
else
minimal_ranges.push_back(*pos);
}
// Use the swap technique in case our new vector is much smaller.
// We must swap when using the STL because std::vector objects never
// release or reduce the memory once it has been allocated/reserved.
// Use the swap technique in case our new vector is much smaller. We must
// swap when using the STL because std::vector objects never release or
// reduce the memory once it has been allocated/reserved.
m_entries.swap(minimal_ranges);
}
}
// Calculate the byte size of ranges with zero byte sizes by finding
// the next entry with a base address > the current base address
// Calculate the byte size of ranges with zero byte sizes by finding the next
// entry with a base address > the current base address
void CalculateSizesOfZeroByteSizeRanges(S full_size = 0) {
#ifdef ASSERT_RANGEMAP_ARE_SORTED
assert(IsSorted());
@ -907,9 +906,9 @@ public:
typename Collection::iterator next;
for (pos = m_entries.begin(), end = m_entries.end(); pos != end; ++pos) {
if (pos->GetByteSize() == 0) {
// Watch out for multiple entries with same address and make sure
// we find an entry that is greater than the current base address
// before we use that for the size
// Watch out for multiple entries with same address and make sure we
// find an entry that is greater than the current base address before
// we use that for the size
auto curr_base = pos->GetRangeBase();
for (next = pos + 1; next != end; ++next) {
auto next_base = next->GetRangeBase();
@ -1060,8 +1059,8 @@ public:
}
// This method will return the entry that contains the given address, or the
// entry following that address. If you give it an address of 0 and the first
// entry starts at address 0x100, you will get the entry at 0x100.
// entry following that address. If you give it an address of 0 and the
// first entry starts at address 0x100, you will get the entry at 0x100.
//
// For most uses, FindEntryThatContains is the correct one to use, this is a
// less commonly needed behavior. It was added for core file memory regions,
@ -1102,8 +1101,8 @@ protected:
//----------------------------------------------------------------------
// A simple range with data class where you get to define the type of
// the range base "B", the type used for the range byte size "S", and
// the type for the associated data "T".
// the range base "B", the type used for the range byte size "S", and the type
// for the associated data "T".
//----------------------------------------------------------------------
template <typename B, typename T> struct AddressData {
typedef B BaseType;

View File

@ -95,14 +95,13 @@ public:
bool GetData(DataExtractor &data) const;
// Copy the register value from this object into a buffer in "dst"
// and obey the "dst_byte_order" when copying the data. Also watch out
// in case "dst_len" is longer or shorter than the register value
// described by "reg_info" and only copy the least significant bytes
// of the register value, or pad the destination with zeroes if the
// register byte size is shorter that "dst_len" (all while correctly
// abiding the "dst_byte_order"). Returns the number of bytes copied
// into "dst".
// Copy the register value from this object into a buffer in "dst" and obey
// the "dst_byte_order" when copying the data. Also watch out in case
// "dst_len" is longer or shorter than the register value described by
// "reg_info" and only copy the least significant bytes of the register
// value, or pad the destination with zeroes if the register byte size is
// shorter that "dst_len" (all while correctly abiding the "dst_byte_order").
// Returns the number of bytes copied into "dst".
uint32_t GetAsMemoryData(const RegisterInfo *reg_info, void *dst,
uint32_t dst_len, lldb::ByteOrder dst_byte_order,
Status &error) const;

View File

@ -40,8 +40,8 @@ struct CStringEqualBinaryPredicate {
};
//----------------------------------------------------------------------
// Templated type for finding an entry in a std::map<F,S> whose value
// is equal to something
// Templated type for finding an entry in a std::map<F,S> whose value is equal
// to something
//----------------------------------------------------------------------
template <class F, class S> class ValueEquals {
public:

View File

@ -36,9 +36,9 @@ namespace lldb_private {
//----------------------------------------------------------------------
// A class designed to hold onto values and their corresponding types.
// Operators are defined and Scalar objects will correctly promote
// their types and values before performing these operations. Type
// promotion currently follows the ANSI C type promotion rules.
// Operators are defined and Scalar objects will correctly promote their types
// and values before performing these operations. Type promotion currently
// follows the ANSI C type promotion rules.
//----------------------------------------------------------------------
class Scalar {
public:
@ -180,10 +180,10 @@ public:
static Scalar::Type GetValueTypeForFloatWithByteSize(size_t byte_size);
//----------------------------------------------------------------------
// All operators can benefits from the implicit conversions that will
// happen automagically by the compiler, so no temporary objects will
// need to be created. As a result, we currently don't need a variety of
// overloaded set value accessors.
// All operators can benefits from the implicit conversions that will happen
// automagically by the compiler, so no temporary objects will need to be
// created. As a result, we currently don't need a variety of overloaded set
// value accessors.
//----------------------------------------------------------------------
Scalar &operator=(const int i);
Scalar &operator=(unsigned int v);
@ -202,27 +202,27 @@ public:
Scalar &operator&=(const Scalar &rhs);
//----------------------------------------------------------------------
// Shifts the current value to the right without maintaining the current
// sign of the value (if it is signed).
// Shifts the current value to the right without maintaining the current sign
// of the value (if it is signed).
//----------------------------------------------------------------------
bool ShiftRightLogical(const Scalar &rhs); // Returns true on success
//----------------------------------------------------------------------
// Takes the absolute value of the current value if it is signed, else
// the value remains unchanged.
// Returns false if the contained value has a void type.
// Takes the absolute value of the current value if it is signed, else the
// value remains unchanged. Returns false if the contained value has a void
// type.
//----------------------------------------------------------------------
bool AbsoluteValue(); // Returns true on success
//----------------------------------------------------------------------
// Negates the current value (even for unsigned values).
// Returns false if the contained value has a void type.
// Negates the current value (even for unsigned values). Returns false if the
// contained value has a void type.
//----------------------------------------------------------------------
bool UnaryNegate(); // Returns true on success
//----------------------------------------------------------------------
// Inverts all bits in the current value as long as it isn't void or
// a float/double/long double type.
// Returns false if the contained value has a void/float/double/long
// double type, else the value is inverted and true is returned.
// Inverts all bits in the current value as long as it isn't void or a
// float/double/long double type. Returns false if the contained value has a
// void/float/double/long double type, else the value is inverted and true is
// returned.
//----------------------------------------------------------------------
bool OnesComplement(); // Returns true on success
@ -232,9 +232,9 @@ public:
Scalar::Type GetType() const { return m_type; }
//----------------------------------------------------------------------
// Returns a casted value of the current contained data without
// modifying the current value. FAIL_VALUE will be returned if the type
// of the value is void or invalid.
// Returns a casted value of the current contained data without modifying the
// current value. FAIL_VALUE will be returned if the type of the value is
// void or invalid.
//----------------------------------------------------------------------
int SInt(int fail_value = 0) const;
@ -342,8 +342,8 @@ private:
};
//----------------------------------------------------------------------
// Split out the operators into a format where the compiler will be able
// to implicitly convert numbers into Scalar objects.
// Split out the operators into a format where the compiler will be able to
// implicitly convert numbers into Scalar objects.
//
// This allows code like:
// Scalar two(2);

View File

@ -303,8 +303,7 @@ protected:
OptionNames name, FileSpecList &file_list);
// These are utility functions to assist with the search iteration. They are
// used by the
// default Search method.
// used by the default Search method.
Searcher::CallbackReturn DoModuleIteration(const SymbolContext &context,
Searcher &searcher);

View File

@ -272,10 +272,9 @@ protected:
SectionList m_children; // Child sections
bool m_fake : 1, // If true, then this section only can contain the address if
// one of its
// children contains an address. This allows for gaps between the children
// that are contained in the address range for this section, but do not
// produce
// hits unless the children contain the address.
// children contains an address. This allows for gaps between the
// children that are contained in the address range for this section, but
// do not produce hits unless the children contain the address.
m_encrypted : 1, // Set to true if the contents are encrypted
m_thread_specific : 1, // This section is thread specific
m_readable : 1, // If this section has read permissions

View File

@ -106,9 +106,8 @@ public:
#ifndef SWIG
// The SourceFileCache class separates the source manager from the cache of
// source files, so the
// cache can be stored in the Debugger, but the source managers can be per
// target.
// source files, so the cache can be stored in the Debugger, but the source
// managers can be per target.
class SourceFileCache {
public:
SourceFileCache() = default;

View File

@ -39,9 +39,8 @@ public:
void Clear() { m_packet.clear(); }
// Beware, this might not be NULL terminated as you can expect from
// StringString as there may be random bits in the llvm::SmallVector. If
// you are using this class to create a C string, be sure the call PutChar
// ('\0')
// StringString as there may be random bits in the llvm::SmallVector. If you
// are using this class to create a C string, be sure the call PutChar ('\0')
// after you have created your string, or use StreamString.
const char *GetData() const { return m_packet.data(); }

View File

@ -25,11 +25,10 @@ namespace lldb_private {
//----------------------------------------------------------------------
// Templatized uniqued string map.
//
// This map is useful for mapping unique C string names to values of
// type T. Each "const char *" name added must be unique for a given
// This map is useful for mapping unique C string names to values of type T.
// Each "const char *" name added must be unique for a given
// C string value. ConstString::GetCString() can provide such strings.
// Any other string table that has guaranteed unique values can also
// be used.
// Any other string table that has guaranteed unique values can also be used.
//----------------------------------------------------------------------
template <typename T> class UniqueCStringMap {
public:
@ -51,9 +50,9 @@ public:
};
//------------------------------------------------------------------
// Call this function multiple times to add a bunch of entries to
// this map, then later call UniqueCStringMap<T>::Sort() before doing
// any searches by name.
// Call this function multiple times to add a bunch of entries to this map,
// then later call UniqueCStringMap<T>::Sort() before doing any searches by
// name.
//------------------------------------------------------------------
void Append(ConstString unique_cstr, const T &value) {
m_map.push_back(typename UniqueCStringMap<T>::Entry(unique_cstr, value));
@ -64,8 +63,8 @@ public:
void Clear() { m_map.clear(); }
//------------------------------------------------------------------
// Call this function to always keep the map sorted when putting
// entries into the map.
// Call this function to always keep the map sorted when putting entries into
// the map.
//------------------------------------------------------------------
void Insert(ConstString unique_cstr, const T &value) {
typename UniqueCStringMap<T>::Entry e(unique_cstr, value);
@ -79,8 +78,8 @@ public:
//------------------------------------------------------------------
// Get an entries by index in a variety of forms.
//
// The caller is responsible for ensuring that the collection does
// not change during while using the returned values.
// The caller is responsible for ensuring that the collection does not change
// during while using the returned values.
//------------------------------------------------------------------
bool GetValueAtIndex(uint32_t idx, T &value) const {
if (idx < m_map.size()) {
@ -94,12 +93,12 @@ public:
return m_map[idx].cstring;
}
// Use this function if you have simple types in your map that you
// can easily copy when accessing values by index.
// Use this function if you have simple types in your map that you can easily
// copy when accessing values by index.
T GetValueAtIndexUnchecked(uint32_t idx) const { return m_map[idx].value; }
// Use this function if you have complex types in your map that you
// don't want to copy when accessing values by index.
// Use this function if you have complex types in your map that you don't
// want to copy when accessing values by index.
const T &GetValueRefAtIndexUnchecked(uint32_t idx) const {
return m_map[idx].value;
}
@ -111,8 +110,8 @@ public:
//------------------------------------------------------------------
// Find the value for the unique string in the map.
//
// Return the value for \a unique_cstr if one is found, return
// \a fail_value otherwise. This method works well for simple type
// Return the value for \a unique_cstr if one is found, return \a fail_value
// otherwise. This method works well for simple type
// T values and only if there is a sensible failure value that can
// be returned and that won't match any existing values.
//------------------------------------------------------------------
@ -128,11 +127,11 @@ public:
}
//------------------------------------------------------------------
// Get a pointer to the first entry that matches "name". nullptr will
// be returned if there is no entry that matches "name".
// Get a pointer to the first entry that matches "name". nullptr will be
// returned if there is no entry that matches "name".
//
// The caller is responsible for ensuring that the collection does
// not change during while using the returned pointer.
// The caller is responsible for ensuring that the collection does not change
// during while using the returned pointer.
//------------------------------------------------------------------
const Entry *FindFirstValueForName(ConstString unique_cstr) const {
Entry search_entry(unique_cstr);
@ -144,12 +143,12 @@ public:
}
//------------------------------------------------------------------
// Get a pointer to the next entry that matches "name" from a
// previously returned Entry pointer. nullptr will be returned if there
// is no subsequent entry that matches "name".
// Get a pointer to the next entry that matches "name" from a previously
// returned Entry pointer. nullptr will be returned if there is no subsequent
// entry that matches "name".
//
// The caller is responsible for ensuring that the collection does
// not change during while using the returned pointer.
// The caller is responsible for ensuring that the collection does not change
// during while using the returned pointer.
//------------------------------------------------------------------
const Entry *FindNextValueForName(const Entry *entry_ptr) const {
if (!m_map.empty()) {
@ -204,16 +203,15 @@ public:
bool IsEmpty() const { return m_map.empty(); }
//------------------------------------------------------------------
// Reserve memory for at least "n" entries in the map. This is
// useful to call when you know you will be adding a lot of entries
// using UniqueCStringMap::Append() (which should be followed by a
// call to UniqueCStringMap::Sort()) or to UniqueCStringMap::Insert().
// Reserve memory for at least "n" entries in the map. This is useful to call
// when you know you will be adding a lot of entries using
// UniqueCStringMap::Append() (which should be followed by a call to
// UniqueCStringMap::Sort()) or to UniqueCStringMap::Insert().
//------------------------------------------------------------------
void Reserve(size_t n) { m_map.reserve(n); }
//------------------------------------------------------------------
// Sort the unsorted contents in this map. A typical code flow would
// be:
// Sort the unsorted contents in this map. A typical code flow would be:
// size_t approximate_num_entries = ....
// UniqueCStringMap<uint32_t> my_map;
// my_map.Reserve (approximate_num_entries);
@ -226,12 +224,11 @@ public:
void Sort() { std::sort(m_map.begin(), m_map.end()); }
//------------------------------------------------------------------
// Since we are using a vector to contain our items it will always
// double its memory consumption as things are added to the vector,
// so if you intend to keep a UniqueCStringMap around and have
// a lot of entries in the map, you will want to call this function
// to create a new vector and copy _only_ the exact size needed as
// part of the finalization of the string map.
// Since we are using a vector to contain our items it will always double its
// memory consumption as things are added to the vector, so if you intend to
// keep a UniqueCStringMap around and have a lot of entries in the map, you
// will want to call this function to create a new vector and copy _only_ the
// exact size needed as part of the finalization of the string map.
//------------------------------------------------------------------
void SizeToFit() {
if (m_map.size() < m_map.capacity()) {

View File

@ -49,8 +49,8 @@ public:
virtual ~Properties() {}
virtual lldb::OptionValuePropertiesSP GetValueProperties() const {
// This function is virtual in case subclasses want to lazily
// implement creating the properties.
// This function is virtual in case subclasses want to lazily implement
// creating the properties.
return m_collection_sp;
}
@ -82,16 +82,11 @@ public:
// We sometimes need to introduce a setting to enable experimental features,
// but then we don't want the setting for these to cause errors when the
// setting
// goes away. Add a sub-topic of the settings using this experimental name,
// and
// two things will happen. One is that settings that don't find the name will
// not
// be treated as errors. Also, if you decide to keep the settings just move
// them into
// the containing properties, and we will auto-forward the experimental
// settings to the
// real one.
// setting goes away. Add a sub-topic of the settings using this
// experimental name, and two things will happen. One is that settings that
// don't find the name will not be treated as errors. Also, if you decide to
// keep the settings just move them into the containing properties, and we
// will auto-forward the experimental settings to the real one.
static const char *GetExperimentalSettingsName();
static bool IsSettingExperimental(llvm::StringRef setting);

View File

@ -48,8 +48,8 @@ namespace lldb_private {
class Value {
public:
// Values Less than zero are an error, greater than or equal to zero
// returns what the Scalar result is.
// Values Less than zero are an error, greater than or equal to zero returns
// what the Scalar result is.
enum ValueType {
// m_value contains...
// ============================
@ -107,8 +107,7 @@ public:
byte_order != lldb::eByteOrderInvalid);
}
// Casts a vector, if valid, to an unsigned int of matching or largest
// supported size.
// Truncates to the beginning of the vector if required.
// supported size. Truncates to the beginning of the vector if required.
// Returns a default constructed Scalar if the Vector data is internally
// inconsistent.
llvm::APInt rhs = llvm::APInt(BITWIDTH_INT128, NUM_OF_WORDS_INT128,

View File

@ -286,10 +286,10 @@ public:
return m_exe_ctx_ref;
}
// Set the EvaluationPoint to the values in exe_scope,
// Return true if the Evaluation Point changed.
// Since the ExecutionContextScope is always going to be valid currently,
// the Updated Context will also always be valid.
// Set the EvaluationPoint to the values in exe_scope, Return true if the
// Evaluation Point changed. Since the ExecutionContextScope is always
// going to be valid currently, the Updated Context will also always be
// valid.
// bool
// SetContext (ExecutionContextScope *exe_scope);
@ -327,8 +327,7 @@ public:
void SetInvalid() {
// Use the stop id to mark us as invalid, leave the thread id and the
// stack id around for logging and
// history purposes.
// stack id around for logging and history purposes.
m_mod_id.SetInvalid();
// Can't update an invalid state.
@ -464,17 +463,16 @@ public:
virtual bool SetValueFromCString(const char *value_str, Status &error);
// Return the module associated with this value object in case the
// value is from an executable file and might have its data in
// sections of the file. This can be used for variables.
// Return the module associated with this value object in case the value is
// from an executable file and might have its data in sections of the file.
// This can be used for variables.
virtual lldb::ModuleSP GetModule();
ValueObject *GetRoot();
// Given a ValueObject, loop over itself and its parent, and its parent's
// parent, ..
// until either the given callback returns false, or you end up at a null
// pointer
// parent, .. until either the given callback returns false, or you end up at
// a null pointer
ValueObject *FollowParentChain(std::function<bool(ValueObject *)>);
virtual bool GetDeclaration(Declaration &decl);
@ -517,9 +515,9 @@ public:
virtual bool ResolveValue(Scalar &scalar);
// return 'false' whenever you set the error, otherwise
// callers may assume true means everything is OK - this will
// break breakpoint conditions among potentially a few others
// return 'false' whenever you set the error, otherwise callers may assume
// true means everything is OK - this will break breakpoint conditions among
// potentially a few others
virtual bool IsLogicalTrue(Status &error);
virtual const char *GetLocationAsCString();
@ -646,8 +644,8 @@ public:
virtual lldb::ValueObjectSP CastPointerType(const char *name,
lldb::TypeSP &type_sp);
// The backing bits of this value object were updated, clear any
// descriptive string, so we know we have to refetch them
// The backing bits of this value object were updated, clear any descriptive
// string, so we know we have to refetch them
virtual void ValueUpdated() {
ClearUserVisibleData(eClearUserVisibleDataItemsValue |
eClearUserVisibleDataItemsSummary |
@ -694,9 +692,8 @@ public:
lldb::ValueObjectSP Persist();
// returns true if this is a char* or a char[]
// if it is a char* and check_pointer is true,
// it also checks that the pointer is valid
// returns true if this is a char* or a char[] if it is a char* and
// check_pointer is true, it also checks that the pointer is valid
bool IsCStringContainer(bool check_pointer = false);
std::pair<size_t, bool>
@ -776,11 +773,9 @@ public:
}
// Use GetParent for display purposes, but if you want to tell the parent to
// update itself
// then use m_parent. The ValueObjectDynamicValue's parent is not the correct
// parent for
// displaying, they are really siblings, so for display it needs to route
// through to its grandparent.
// update itself then use m_parent. The ValueObjectDynamicValue's parent is
// not the correct parent for displaying, they are really siblings, so for
// display it needs to route through to its grandparent.
virtual ValueObject *GetParent() { return m_parent; }
virtual const ValueObject *GetParent() const { return m_parent; }
@ -904,9 +899,9 @@ protected:
ValueObjectManager *m_manager; // This object is managed by the root object
// (any ValueObject that gets created
// without a parent.) The manager gets passed through all the generations of
// dependent objects, and will keep the whole cluster of objects alive as long
// as a shared pointer to any of them has been handed out. Shared pointers to
// value objects must always be made with the GetSP method.
// dependent objects, and will keep the whole cluster of objects alive as
// long as a shared pointer to any of them has been handed out. Shared
// pointers to value objects must always be made with the GetSP method.
ChildrenManager m_children;
std::map<ConstString, ValueObject *> m_synthetic_children;
@ -954,21 +949,19 @@ protected:
// Constructors and Destructors
//------------------------------------------------------------------
// Use the no-argument constructor to make a constant variable object (with no
// ExecutionContextScope.)
// Use the no-argument constructor to make a constant variable object (with
// no ExecutionContextScope.)
ValueObject();
// Use this constructor to create a "root variable object". The ValueObject
// will be locked to this context
// through-out its lifespan.
// will be locked to this context through-out its lifespan.
ValueObject(ExecutionContextScope *exe_scope,
AddressType child_ptr_or_ref_addr_type = eAddressTypeLoad);
// Use this constructor to create a ValueObject owned by another ValueObject.
// It will inherit the ExecutionContext
// of its parent.
// It will inherit the ExecutionContext of its parent.
ValueObject(ValueObject &parent);
@ -990,8 +983,8 @@ protected:
virtual void CalculateSyntheticValue(bool use_synthetic = true);
// Should only be called by ValueObject::GetChildAtIndex()
// Returns a ValueObject managed by this ValueObject's manager.
// Should only be called by ValueObject::GetChildAtIndex() Returns a
// ValueObject managed by this ValueObject's manager.
virtual ValueObject *CreateChildAtIndex(size_t idx,
bool synthetic_array_member,
int32_t synthetic_index);
@ -1043,8 +1036,9 @@ private:
//------------------------------------------------------------------------------
// A value object manager class that is seeded with the static variable value
// and it vends the user facing value object. If the type is dynamic it can
// vend the dynamic type. If this user type also has a synthetic type associated
// with it, it will vend the synthetic type. The class watches the process' stop
// vend the dynamic type. If this user type also has a synthetic type
// associated with it, it will vend the synthetic type. The class watches the
// process' stop
// ID and will update the user type when needed.
//------------------------------------------------------------------------------
class ValueObjectManager {

View File

@ -39,9 +39,9 @@ namespace lldb_private {
//----------------------------------------------------------------------
// A ValueObject that obtains its children from some source other than
// real information
// This is currently used to implement Python-based children and filters
// but you can bind it to any source of synthetic information and have
// it behave accordingly
// This is currently used to implement Python-based children and filters but
// you can bind it to any source of synthetic information and have it behave
// accordingly
//----------------------------------------------------------------------
class ValueObjectSynthetic : public ValueObject {
public:

View File

@ -21,15 +21,14 @@
namespace lldb_private {
// this class is the high-level front-end of LLDB Data Visualization
// code in FormatManager.h/cpp is the low-level implementation of this feature
// clients should refer to this class as the entry-point into the data
// formatters
// this class is the high-level front-end of LLDB Data Visualization code in
// FormatManager.h/cpp is the low-level implementation of this feature clients
// should refer to this class as the entry-point into the data formatters
// unless they have a good reason to bypass this and go to the backend
class DataVisualization {
public:
// use this call to force the FM to consider itself updated even when there is
// no apparent reason for that
// use this call to force the FM to consider itself updated even when there
// is no apparent reason for that
static void ForceUpdate();
static uint32_t GetCurrentRevision();

View File

@ -160,8 +160,8 @@ public:
private:
bool m_is_regex;
// this works better than TypeAndOrName because the latter only wraps a TypeSP
// whereas TypePair can also be backed by a CompilerType
// this works better than TypeAndOrName because the latter only wraps a
// TypeSP whereas TypePair can also be backed by a CompilerType
struct TypeOrName {
std::string m_type_name;
TypePair m_type_pair;

View File

@ -33,12 +33,10 @@
namespace lldb_private {
// this file (and its. cpp) contain the low-level implementation of LLDB Data
// Visualization
// class DataVisualization is the high-level front-end of this feature
// clients should refer to that class as the entry-point into the data
// formatters
// unless they have a good reason to bypass it and prefer to use this file's
// objects directly
// Visualization class DataVisualization is the high-level front-end of this
// feature clients should refer to that class as the entry-point into the data
// formatters unless they have a good reason to bypass it and prefer to use
// this file's objects directly
class FormatManager : public IFormatChangeListener {
typedef FormatMap<ConstString, TypeSummaryImpl> NamedSummariesMap;
@ -175,24 +173,22 @@ public:
static const char *GetFormatAsCString(lldb::Format format);
// if the user tries to add formatters for, say, "struct Foo"
// those will not match any type because of the way we strip qualifiers from
// typenames
// this method looks for the case where the user is adding a
// "class","struct","enum" or "union" Foo
// and strips the unnecessary qualifier
// if the user tries to add formatters for, say, "struct Foo" those will not
// match any type because of the way we strip qualifiers from typenames this
// method looks for the case where the user is adding a
// "class","struct","enum" or "union" Foo and strips the unnecessary
// qualifier
static ConstString GetValidTypeName(const ConstString &type);
// when DataExtractor dumps a vectorOfT, it uses a predefined format for each
// item
// this method returns it, or eFormatInvalid if vector_format is not a
// item this method returns it, or eFormatInvalid if vector_format is not a
// vectorOf
static lldb::Format GetSingleItemFormat(lldb::Format vector_format);
// this returns true if the ValueObjectPrinter is *highly encouraged*
// to actually represent this ValueObject in one-liner format
// If this object has a summary formatter, however, we should not
// try and do one-lining, just let the summary do the right thing
// this returns true if the ValueObjectPrinter is *highly encouraged* to
// actually represent this ValueObject in one-liner format If this object has
// a summary formatter, however, we should not try and do one-lining, just
// let the summary do the right thing
bool ShouldPrintAsOneLiner(ValueObject &valobj);
void Changed() override;
@ -249,15 +245,12 @@ private:
TypeCategoryMap &GetCategories() { return m_categories_map; }
// These functions are meant to initialize formatters that are very
// low-level/global in nature
// and do not naturally belong in any language. The intent is that most
// formatters go in
// language-specific categories. Eventually, the runtimes should also be
// allowed to vend their
// own formatters, and then one could put formatters that depend on specific
// library load events
// in the language runtimes, on an as-needed basis
// These functions are meant to initialize formatters that are very low-
// level/global in nature and do not naturally belong in any language. The
// intent is that most formatters go in language-specific categories.
// Eventually, the runtimes should also be allowed to vend their own
// formatters, and then one could put formatters that depend on specific
// library load events in the language runtimes, on an as-needed basis
void LoadSystemFormatters();
void LoadVectorFormatters();

View File

@ -43,12 +43,10 @@ public:
virtual uint32_t GetCurrentRevision() = 0;
};
// if the user tries to add formatters for, say, "struct Foo"
// those will not match any type because of the way we strip qualifiers from
// typenames
// this method looks for the case where the user is adding a
// "class","struct","enum" or "union" Foo
// and strips the unnecessary qualifier
// if the user tries to add formatters for, say, "struct Foo" those will not
// match any type because of the way we strip qualifiers from typenames this
// method looks for the case where the user is adding a "class","struct","enum"
// or "union" Foo and strips the unnecessary qualifier
static inline ConstString GetValidTypeName_Impl(const ConstString &type) {
if (type.IsEmpty())
return type;

View File

@ -266,8 +266,7 @@ public:
// I can't use a std::unique_ptr for this because the Deleter is a template
// argument there
// and I want the same type to represent both pointers I want to free and
// pointers I don't need
// to free - which is what this class essentially is
// pointers I don't need to free - which is what this class essentially is
// It's very specialized to the needs of this file, and not suggested for
// general use
template <typename T = uint8_t, typename U = char, typename S = size_t>

View File

@ -146,10 +146,9 @@ public:
virtual Type GetType() { return Type::eTypeUnknown; }
// we are using a ValueObject* instead of a ValueObjectSP because we do not
// need to hold on to this for
// extended periods of time and we trust the ValueObject to stay around for as
// long as it is required
// for us to generate its value
// need to hold on to this for extended periods of time and we trust the
// ValueObject to stay around for as long as it is required for us to
// generate its value
virtual bool FormatObject(ValueObject *valobj, std::string &dest) const = 0;
virtual std::string GetDescription() = 0;

View File

@ -258,10 +258,9 @@ public:
void SetOptions(uint32_t value) { m_flags.SetValue(value); }
// we are using a ValueObject* instead of a ValueObjectSP because we do not
// need to hold on to this for
// extended periods of time and we trust the ValueObject to stay around for as
// long as it is required
// for us to generate its summary
// need to hold on to this for extended periods of time and we trust the
// ValueObject to stay around for as long as it is required for us to
// generate its summary
virtual bool FormatObject(ValueObject *valobj, std::string &dest,
const TypeSummaryOptions &options) = 0;
@ -311,8 +310,8 @@ private:
// summaries implemented via a C++ function
struct CXXFunctionSummaryFormat : public TypeSummaryImpl {
// we should convert these to SBValue and SBStream if we ever cross
// the boundary towards the external world
// we should convert these to SBValue and SBStream if we ever cross the
// boundary towards the external world
typedef std::function<bool(ValueObject &, Stream &,
const TypeSummaryOptions &)>
Callback;

View File

@ -55,34 +55,29 @@ public:
virtual size_t GetIndexOfChildWithName(const ConstString &name) = 0;
// this function is assumed to always succeed and it if fails, the front-end
// should know to deal
// with it in the correct way (most probably, by refusing to return any
// children)
// the return value of Update() should actually be interpreted as
// "ValueObjectSyntheticFilter cache is good/bad"
// if =true, ValueObjectSyntheticFilter is allowed to use the children it
// fetched previously and cached
// if =false, ValueObjectSyntheticFilter must throw away its cache, and query
// again for children
// should know to deal with it in the correct way (most probably, by refusing
// to return any children) the return value of Update() should actually be
// interpreted as "ValueObjectSyntheticFilter cache is good/bad" if =true,
// ValueObjectSyntheticFilter is allowed to use the children it fetched
// previously and cached if =false, ValueObjectSyntheticFilter must throw
// away its cache, and query again for children
virtual bool Update() = 0;
// if this function returns false, then CalculateNumChildren() MUST return 0
// since UI frontends
// might validly decide not to inquire for children given a false return value
// from this call
// if it returns true, then CalculateNumChildren() can return any number >= 0
// (0 being valid)
// it should if at all possible be more efficient than CalculateNumChildren()
// since UI frontends might validly decide not to inquire for children given
// a false return value from this call if it returns true, then
// CalculateNumChildren() can return any number >= 0 (0 being valid) it
// should if at all possible be more efficient than CalculateNumChildren()
virtual bool MightHaveChildren() = 0;
// if this function returns a non-null ValueObject, then the returned
// ValueObject will stand
// for this ValueObject whenever a "value" request is made to this ValueObject
// ValueObject will stand for this ValueObject whenever a "value" request is
// made to this ValueObject
virtual lldb::ValueObjectSP GetSyntheticValue() { return nullptr; }
// if this function returns a non-empty ConstString, then clients are expected
// to use the return
// as the name of the type of this ValueObject for display purposes
// if this function returns a non-empty ConstString, then clients are
// expected to use the return as the name of the type of this ValueObject for
// display purposes
virtual ConstString GetSyntheticTypeName() { return ConstString(); }
typedef std::shared_ptr<SyntheticChildrenFrontEnd> SharedPointer;

View File

@ -147,10 +147,9 @@ public:
virtual Type GetType() { return Type::eTypeUnknown; }
// we are using a ValueObject* instead of a ValueObjectSP because we do not
// need to hold on to this for
// extended periods of time and we trust the ValueObject to stay around for as
// long as it is required
// for us to generate its value
// need to hold on to this for extended periods of time and we trust the
// ValueObject to stay around for as long as it is required for us to
// generate its value
virtual ValidationResult FormatObject(ValueObject *valobj) const = 0;
virtual std::string GetDescription() = 0;

View File

@ -47,16 +47,16 @@ protected:
InstancePointersSetSP m_printed_instance_pointers;
// only this class (and subclasses, if any) should ever be concerned with
// the depth mechanism
// only this class (and subclasses, if any) should ever be concerned with the
// depth mechanism
ValueObjectPrinter(ValueObject *valobj, Stream *s,
const DumpValueObjectOptions &options,
const DumpValueObjectOptions::PointerDepth &ptr_depth,
uint32_t curr_depth,
InstancePointersSetSP printed_instance_pointers);
// we should actually be using delegating constructors here
// but some versions of GCC still have trouble with those
// we should actually be using delegating constructors here but some versions
// of GCC still have trouble with those
void Init(ValueObject *valobj, Stream *s,
const DumpValueObjectOptions &options,
const DumpValueObjectOptions::PointerDepth &ptr_depth,

View File

@ -40,9 +40,8 @@ public:
bool static_method, ExecutionContext &exe_ctx) const;
// Given a string returned by GetText, find the beginning and end of the body
// passed to CreateWrapped.
// Return true if the bounds could be found. This will also work on text with
// FixItHints applied.
// passed to CreateWrapped. Return true if the bounds could be found. This
// will also work on text with FixItHints applied.
static bool GetOriginalBodyBounds(std::string transformed_text,
lldb::LanguageType wrapping_language,
size_t &start_loc, size_t &end_loc);

View File

@ -69,15 +69,12 @@ public:
void SetName(const ConstString &name) { m_frozen_sp->SetName(name); }
// this function is used to copy the address-of m_live_sp into m_frozen_sp
// this is necessary because the results of certain cast and
// pointer-arithmetic
// operations (such as those described in bugzilla issues 11588 and 11618)
// generate
// frozen objects that do not have a valid address-of, which can be
// troublesome when
// using synthetic children providers. Transferring the address-of the live
// object
// solves these issues and provides the expected user-level behavior
// this is necessary because the results of certain cast and pointer-
// arithmetic operations (such as those described in bugzilla issues 11588
// and 11618) generate frozen objects that do not have a valid address-of,
// which can be troublesome when using synthetic children providers.
// Transferring the address-of the live object solves these issues and
// provides the expected user-level behavior
void TransferAddress(bool force = false) {
if (m_live_sp.get() == nullptr)
return;

View File

@ -83,8 +83,8 @@ public:
lldb::TargetSP GetTarget() { return m_target_wp.lock(); }
protected:
// This function should only be used if you know you are using the JIT.
// Any other cases should use GetBestExecutionContextScope().
// This function should only be used if you know you are using the JIT. Any
// other cases should use GetBestExecutionContextScope().
lldb::ProcessWP &GetProcessWP() { return m_process_wp; }

View File

@ -39,12 +39,11 @@ namespace lldb_private {
class LLVMUserExpression : public UserExpression {
public:
// The IRPasses struct is filled in by a runtime after an expression is
// compiled and can be used to to run
// fixups/analysis passes as required. EarlyPasses are run on the generated
// module before lldb runs its own IR
// compiled and can be used to to run fixups/analysis passes as required.
// EarlyPasses are run on the generated module before lldb runs its own IR
// fixups and inserts instrumentation code/pointer checks. LatePasses are run
// after the module has been processed by
// llvm, before the module is assembled and run in the ThreadPlan.
// after the module has been processed by llvm, before the module is
// assembled and run in the ThreadPlan.
struct IRPasses {
IRPasses() : EarlyPasses(nullptr), LatePasses(nullptr){};
std::shared_ptr<llvm::legacy::PassManager> EarlyPasses;

View File

@ -80,8 +80,8 @@ public:
/// false if not (or the function is not JIT compiled)
//------------------------------------------------------------------
bool ContainsAddress(lldb::addr_t address) {
// nothing is both >= LLDB_INVALID_ADDRESS and < LLDB_INVALID_ADDRESS,
// so this always returns false if the function is not JIT compiled yet
// nothing is both >= LLDB_INVALID_ADDRESS and < LLDB_INVALID_ADDRESS, so
// this always returns false if the function is not JIT compiled yet
return (address >= m_jit_start_addr && address < m_jit_end_addr);
}
@ -116,10 +116,9 @@ public:
//------------------------------------------------------------------
bool NeedsVariableResolution() override { return false; }
// This makes the function caller function.
// Pass in the ThreadSP if you have one available, compilation can end up
// calling code (e.g. to look up indirect
// functions) and we don't want this to wander onto another thread.
// This makes the function caller function. Pass in the ThreadSP if you have
// one available, compilation can end up calling code (e.g. to look up
// indirect functions) and we don't want this to wander onto another thread.
FunctionCaller *MakeFunctionCaller(const CompilerType &return_type,
const ValueList &arg_value_list,
lldb::ThreadSP compilation_thread,

View File

@ -25,7 +25,8 @@ namespace lldb_private {
//------------------------------------------------------------------
struct ResumeAction {
lldb::tid_t tid; // The thread ID that this action applies to,
// LLDB_INVALID_THREAD_ID for the default thread action
// LLDB_INVALID_THREAD_ID for the default thread
// action
lldb::StateType state; // Valid values are eStateStopped/eStateSuspended,
// eStateRunning, and eStateStepping.
int signal; // When resuming this thread, resume it with this signal if this
@ -34,10 +35,9 @@ struct ResumeAction {
//------------------------------------------------------------------
// A class that contains instructions for all threads for
// NativeProcessProtocol::Resume(). Each thread can either run, stay
// suspended, or step when the process is resumed. We optionally
// have the ability to also send a signal to the thread when the
// action is run or step.
// NativeProcessProtocol::Resume(). Each thread can either run, stay suspended,
// or step when the process is resumed. We optionally have the ability to also
// send a signal to the thread when the action is run or step.
//------------------------------------------------------------------
class ResumeActionList {
public:

View File

@ -23,8 +23,8 @@
// broken, which is why we're
// working around it here.
// c) When resizing the terminal window, if the cursor moves between rows
// libedit will get confused.
// d) The incremental search uses escape to cancel input, so it's confused by
// libedit will get confused. d) The incremental search uses escape to cancel
// input, so it's confused by
// ANSI sequences starting with escape.
// e) Emoji support is fairly terrible, presumably it doesn't understand
// composed characters?
@ -38,11 +38,10 @@
#include <vector>
// components needed to handle wide characters ( <codecvt>, codecvt_utf8,
// libedit built with '--enable-widec' )
// are available on some platforms. The wchar_t versions of libedit functions
// will only be
// used in cases where this is true. This is a compile time dependecy, for now
// selected per target Platform
// libedit built with '--enable-widec' ) are available on some platforms. The
// wchar_t versions of libedit functions will only be used in cases where this
// is true. This is a compile time dependecy, for now selected per target
// Platform
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || \
defined(__OpenBSD__)
#define LLDB_EDITLINE_USE_WCHAR 1

View File

@ -21,12 +21,12 @@
namespace lldb_private {
// Implementation of the MainLoopBase class. It can monitor file descriptors for
// readability using ppoll, kqueue, poll or WSAPoll. On Windows it only supports
// polling sockets, and will not work on generic file handles or pipes. On
// systems without kqueue or ppoll handling singnals is not supported. In
// addition to the common base, this class provides the ability to invoke a
// given handler when a signal is received.
// Implementation of the MainLoopBase class. It can monitor file descriptors
// for readability using ppoll, kqueue, poll or WSAPoll. On Windows it only
// supports polling sockets, and will not work on generic file handles or
// pipes. On systems without kqueue or ppoll handling singnals is not
// supported. In addition to the common base, this class provides the ability
// to invoke a given handler when a signal is received.
//
// Since this class is primarily intended to be used for single-threaded
// processing, it does not attempt to perform any internal synchronisation and
@ -49,13 +49,13 @@ public:
const Callback &callback,
Status &error) override;
// Listening for signals from multiple MainLoop instances is perfectly safe as
// long as they don't try to listen for the same signal. The callback function
// is invoked when the control returns to the Run() function, not when the
// hander is executed. This mean that you can treat the callback as a normal
// function and perform things which would not be safe in a signal handler.
// However, since the callback is not invoked synchronously, you cannot use
// this mechanism to handle SIGSEGV and the like.
// Listening for signals from multiple MainLoop instances is perfectly safe
// as long as they don't try to listen for the same signal. The callback
// function is invoked when the control returns to the Run() function, not
// when the hander is executed. This mean that you can treat the callback as
// a normal function and perform things which would not be safe in a signal
// handler. However, since the callback is not invoked synchronously, you
// cannot use this mechanism to handle SIGSEGV and the like.
SignalHandleUP RegisterSignal(int signo, const Callback &callback,
Status &error);

View File

@ -18,21 +18,17 @@
namespace lldb_private {
// The purpose of this class is to enable multiplexed processing of data from
// different sources
// without resorting to multi-threading. Clients can register IOObjects, which
// will be monitored
// for readability, and when they become ready, the specified callback will be
// invoked.
// Monitoring for writability is not supported, but can be easily added if
// needed.
// different sources without resorting to multi-threading. Clients can register
// IOObjects, which will be monitored for readability, and when they become
// ready, the specified callback will be invoked. Monitoring for writability is
// not supported, but can be easily added if needed.
//
// The RegisterReadObject function return a handle, which controls the duration
// of the monitoring. When
// this handle is destroyed, the callback is deregistered.
// of the monitoring. When this handle is destroyed, the callback is
// deregistered.
//
// This class simply defines the interface common for all platforms, actual
// implementations are
// platform-specific.
// implementations are platform-specific.
class MainLoopBase {
private:
class ReadHandle;
@ -52,8 +48,7 @@ public:
}
// Waits for registered events and invoke the proper callbacks. Returns when
// all callbacks
// deregister themselves or when someone requests termination.
// all callbacks deregister themselves or when someone requests termination.
virtual Status Run() { llvm_unreachable("Not implemented"); }
// Requests the exit of the Run() function.

View File

@ -11,8 +11,8 @@
#define liblldb_Host_PosixApi_h
// This file defines platform specific functions, macros, and types necessary
// to provide a minimum level of compatibility across all platforms to rely
// on various posix api functionality.
// to provide a minimum level of compatibility across all platforms to rely on
// various posix api functionality.
#if defined(_WIN32)
#include "lldb/Host/windows/PosixApi.h"

View File

@ -199,11 +199,11 @@ public:
//------------------------------------------------------------------
T WaitForSetValueBits(T bits, const std::chrono::microseconds &timeout =
std::chrono::microseconds(0)) {
// pthread_cond_timedwait() or pthread_cond_wait() will atomically
// unlock the mutex and wait for the condition to be set. When either
// function returns, they will re-lock the mutex. We use an auto lock/unlock
// class (std::lock_guard) to allow us to return at any point in this
// function and not have to worry about unlocking the mutex.
// pthread_cond_timedwait() or pthread_cond_wait() will atomically unlock
// the mutex and wait for the condition to be set. When either function
// returns, they will re-lock the mutex. We use an auto lock/unlock class
// (std::lock_guard) to allow us to return at any point in this function
// and not have to worry about unlocking the mutex.
std::unique_lock<std::mutex> lock(m_mutex);
#ifdef DB_PTHREAD_LOG_EVENTS
printf("%s (bits = 0x%8.8x, timeout = %llu), m_value = 0x%8.8x\n",
@ -253,11 +253,11 @@ public:
//------------------------------------------------------------------
T WaitForResetValueBits(T bits, const std::chrono::microseconds &timeout =
std::chrono::microseconds(0)) {
// pthread_cond_timedwait() or pthread_cond_wait() will atomically
// unlock the mutex and wait for the condition to be set. When either
// function returns, they will re-lock the mutex. We use an auto lock/unlock
// class (std::lock_guard) to allow us to return at any point in this
// function and not have to worry about unlocking the mutex.
// pthread_cond_timedwait() or pthread_cond_wait() will atomically unlock
// the mutex and wait for the condition to be set. When either function
// returns, they will re-lock the mutex. We use an auto lock/unlock class
// (std::lock_guard) to allow us to return at any point in this function
// and not have to worry about unlocking the mutex.
std::unique_lock<std::mutex> lock(m_mutex);
#ifdef DB_PTHREAD_LOG_EVENTS
@ -313,11 +313,11 @@ public:
bool WaitForValueEqualTo(T value, const std::chrono::microseconds &timeout =
std::chrono::microseconds(0),
bool *timed_out = nullptr) {
// pthread_cond_timedwait() or pthread_cond_wait() will atomically
// unlock the mutex and wait for the condition to be set. When either
// function returns, they will re-lock the mutex. We use an auto lock/unlock
// class (std::lock_guard) to allow us to return at any point in this
// function and not have to worry about unlocking the mutex.
// pthread_cond_timedwait() or pthread_cond_wait() will atomically unlock
// the mutex and wait for the condition to be set. When either function
// returns, they will re-lock the mutex. We use an auto lock/unlock class
// (std::lock_guard) to allow us to return at any point in this function
// and not have to worry about unlocking the mutex.
std::unique_lock<std::mutex> lock(m_mutex);
#ifdef DB_PTHREAD_LOG_EVENTS
@ -382,11 +382,11 @@ public:
T wait_value, T new_value,
const std::chrono::microseconds &timeout = std::chrono::microseconds(0),
bool *timed_out = nullptr) {
// pthread_cond_timedwait() or pthread_cond_wait() will atomically
// unlock the mutex and wait for the condition to be set. When either
// function returns, they will re-lock the mutex. We use an auto lock/unlock
// class (std::lock_guard) to allow us to return at any point in this
// function and not have to worry about unlocking the mutex.
// pthread_cond_timedwait() or pthread_cond_wait() will atomically unlock
// the mutex and wait for the condition to be set. When either function
// returns, they will re-lock the mutex. We use an auto lock/unlock class
// (std::lock_guard) to allow us to return at any point in this function
// and not have to worry about unlocking the mutex.
std::unique_lock<std::mutex> lock(m_mutex);
#ifdef DB_PTHREAD_LOG_EVENTS
@ -449,11 +449,11 @@ public:
bool WaitForValueNotEqualTo(
T value, T &new_value,
const std::chrono::microseconds &timeout = std::chrono::microseconds(0)) {
// pthread_cond_timedwait() or pthread_cond_wait() will atomically
// unlock the mutex and wait for the condition to be set. When either
// function returns, they will re-lock the mutex. We use an auto lock/unlock
// class (std::lock_guard) to allow us to return at any point in this
// function and not have to worry about unlocking the mutex.
// pthread_cond_timedwait() or pthread_cond_wait() will atomically unlock
// the mutex and wait for the condition to be set. When either function
// returns, they will re-lock the mutex. We use an auto lock/unlock class
// (std::lock_guard) to allow us to return at any point in this function
// and not have to worry about unlocking the mutex.
std::unique_lock<std::mutex> lock(m_mutex);
#ifdef DB_PTHREAD_LOG_EVENTS
printf("%s (value = 0x%8.8x, timeout = %llu), m_value = 0x%8.8x\n",
@ -478,8 +478,8 @@ public:
protected:
//----------------------------------------------------------------------
// pthread condition and mutex variable to control access and allow
// blocking between the main thread and the spotlight index thread.
// pthread condition and mutex variable to control access and allow blocking
// between the main thread and the spotlight index thread.
//----------------------------------------------------------------------
T m_value; ///< The templatized value T that we are protecting access to
mutable std::mutex m_mutex; ///< The mutex to use when accessing the data

View File

@ -60,10 +60,8 @@ public:
virtual Status Accept(Socket *&socket) = 0;
// Initialize a Tcp Socket object in listening mode. listen and accept are
// implemented
// separately because the caller may wish to manipulate or query the socket
// after it is
// initialized, but before entering a blocking accept.
// implemented separately because the caller may wish to manipulate or query
// the socket after it is initialized, but before entering a blocking accept.
static Status TcpListen(llvm::StringRef host_and_port,
bool child_processes_inherit, Socket *&socket,
Predicate<uint16_t> *predicate, int backlog = 5);

View File

@ -111,17 +111,16 @@ public:
uint16_t GetPort() const;
//------------------------------------------------------------------
// Set the port if the socket address for the family has a port.
// The family must be set correctly prior to calling this function.
// Set the port if the socket address for the family has a port. The family
// must be set correctly prior to calling this function.
//------------------------------------------------------------------
bool SetPort(uint16_t port);
//------------------------------------------------------------------
// Set the socket address according to the first match from a call
// to getaddrinfo() (or equivalent functions for systems that don't
// have getaddrinfo(). If "addr_info_ptr" is not NULL, it will get
// filled in with the match that was used to populate this socket
// address.
// Set the socket address according to the first match from a call to
// getaddrinfo() (or equivalent functions for systems that don't have
// getaddrinfo(). If "addr_info_ptr" is not NULL, it will get filled in with
// the match that was used to populate this socket address.
//------------------------------------------------------------------
bool
getaddrinfo(const char *host, // Hostname ("foo.bar.com" or "foo" or IP
@ -133,9 +132,9 @@ public:
int ai_protocol = 0, int ai_flags = 0);
//------------------------------------------------------------------
// Quick way to set the SocketAddress to localhost given the family.
// Returns true if successful, false if "family" doesn't support
// localhost or if "family" is not supported by this class.
// Quick way to set the SocketAddress to localhost given the family. Returns
// true if successful, false if "family" doesn't support localhost or if
// "family" is not supported by this class.
//------------------------------------------------------------------
bool SetToLocalhost(sa_family_t family, uint16_t port);
@ -190,11 +189,10 @@ public:
}
//------------------------------------------------------------------
// Conversion operators to allow getting the contents of this class
// as a pointer to the appropriate structure. This allows an instance
// of this class to be used in calls that take one of the sockaddr
// structure variants without having to manually use the correct
// accessor function.
// Conversion operators to allow getting the contents of this class as a
// pointer to the appropriate structure. This allows an instance of this
// class to be used in calls that take one of the sockaddr structure variants
// without having to manually use the correct accessor function.
//------------------------------------------------------------------
operator struct sockaddr *() { return &m_socket_addr.sa; }

View File

@ -29,16 +29,16 @@ public:
//----------------------------------------------------------------------
// Locate the executable file given a module specification.
//
// Locating the file should happen only on the local computer or using
// the current computers global settings.
// Locating the file should happen only on the local computer or using the
// current computers global settings.
//----------------------------------------------------------------------
static ModuleSpec LocateExecutableObjectFile(const ModuleSpec &module_spec);
//----------------------------------------------------------------------
// Locate the symbol file given a module specification.
//
// Locating the file should happen only on the local computer or using
// the current computers global settings.
// Locating the file should happen only on the local computer or using the
// current computers global settings.
//----------------------------------------------------------------------
static FileSpec LocateExecutableSymbolFile(const ModuleSpec &module_spec);
@ -51,10 +51,10 @@ public:
//
// Locating the file can try to download the file from a corporate build
// repository, or using any other means necessary to locate both the
// unstripped object file and the debug symbols.
// The force_lookup argument controls whether the external program is called
// unconditionally to find the symbol file, or if the user's settings are
// checked to see if they've enabled the external program before calling.
// unstripped object file and the debug symbols. The force_lookup argument
// controls whether the external program is called unconditionally to find
// the symbol file, or if the user's settings are checked to see if they've
// enabled the external program before calling.
//
//----------------------------------------------------------------------
static bool DownloadObjectAndSymbolFile(ModuleSpec &module_spec,

View File

@ -20,32 +20,27 @@
namespace lldb_private {
// Global TaskPool class for running tasks in parallel on a set of worker thread
// created the first
// time the task pool is used. The TaskPool provide no guarantee about the order
// the task will be run
// and about what tasks will run in parallel. None of the task added to the task
// pool should block
// on something (mutex, future, condition variable) what will be set only by the
// completion of an
// other task on the task pool as they may run on the same thread sequentally.
// Global TaskPool class for running tasks in parallel on a set of worker
// thread created the first time the task pool is used. The TaskPool provide no
// guarantee about the order the task will be run and about what tasks will run
// in parallel. None of the task added to the task pool should block on
// something (mutex, future, condition variable) what will be set only by the
// completion of an other task on the task pool as they may run on the same
// thread sequentally.
class TaskPool {
public:
// Add a new task to the task pool and return a std::future belonging to the
// newly created task.
// The caller of this function has to wait on the future for this task to
// complete.
// newly created task. The caller of this function has to wait on the future
// for this task to complete.
template <typename F, typename... Args>
static std::future<typename std::result_of<F(Args...)>::type>
AddTask(F &&f, Args &&... args);
// Run all of the specified tasks on the task pool and wait until all of them
// are finished
// before returning. This method is intended to be used for small number tasks
// where listing
// them as function arguments is acceptable. For running large number of tasks
// you should use
// AddTask for each task and then call wait() on each returned future.
// are finished before returning. This method is intended to be used for
// small number tasks where listing them as function arguments is acceptable.
// For running large number of tasks you should use AddTask for each task and
// then call wait() on each returned future.
template <typename... T> static void RunTasks(T &&... tasks);
private:

View File

@ -100,8 +100,8 @@ public:
void ForEachSiblingElement(NodeCallback const &callback) const;
//----------------------------------------------------------------------
// Iterate through only the sibling nodes that are elements and whose
// name matches \a name.
// Iterate through only the sibling nodes that are elements and whose name
// matches \a name.
//----------------------------------------------------------------------
void ForEachSiblingElementWithName(const char *name,
NodeCallback const &callback) const;
@ -137,8 +137,8 @@ public:
const char *url = "untitled.xml");
//----------------------------------------------------------------------
// If \a name is nullptr, just get the root element node, else only return
// a value XMLNode if the name of the root element matches \a name.
// If \a name is nullptr, just get the root element node, else only return a
// value XMLNode if the name of the root element matches \a name.
//----------------------------------------------------------------------
XMLNode GetRootElement(const char *required_name = nullptr);
@ -176,12 +176,11 @@ public:
StructuredData::ObjectSP GetStructuredData();
protected:
// Using a node returned from GetValueNode() extract its value as a
// string (if possible). Array and dictionary nodes will return false
// as they have no string value. Boolean nodes will return true and
// \a value will be "true" or "false" as the string value comes from
// the element name itself. All other nodes will return the text
// content of the XMLNode.
// Using a node returned from GetValueNode() extract its value as a string
// (if possible). Array and dictionary nodes will return false as they have
// no string value. Boolean nodes will return true and \a value will be
// "true" or "false" as the string value comes from the element name itself.
// All other nodes will return the text content of the XMLNode.
static bool ExtractStringFromValueNode(const XMLNode &node,
std::string &value);

View File

@ -19,8 +19,8 @@
// option structure
struct option {
const char *name;
// has_arg can't be an enum because some compilers complain about
// type mismatches in all the code that assumes it is an int.
// has_arg can't be an enum because some compilers complain about type
// mismatches in all the code that assumes it is an int.
int has_arg;
int *flag;
int val;

View File

@ -45,8 +45,8 @@ protected:
private:
bool m_enabled;
// -----------------------------------------------------------
// interface for NativeBreakpointList
// ----------------------------------------------------------- interface for
// NativeBreakpointList
// -----------------------------------------------------------
void AddRef();
int32_t DecRef();

View File

@ -69,8 +69,8 @@ public:
virtual Status Kill() = 0;
//------------------------------------------------------------------
// Tells a process not to stop the inferior on given signals
// and just reinject them back.
// Tells a process not to stop the inferior on given signals and just
// reinject them back.
//------------------------------------------------------------------
virtual Status IgnoreSignals(llvm::ArrayRef<int> signals);
@ -421,33 +421,30 @@ protected:
int m_terminal_fd;
uint32_t m_stop_id = 0;
// Set of signal numbers that LLDB directly injects back to inferior
// without stopping it.
// Set of signal numbers that LLDB directly injects back to inferior without
// stopping it.
llvm::DenseSet<int> m_signals_to_ignore;
// lldb_private::Host calls should be used to launch a process for debugging,
// and
// then the process should be attached to. When attaching to a process
// lldb_private::Host calls should be used to locate the process to attach to,
// and then this function should be called.
// and then the process should be attached to. When attaching to a process
// lldb_private::Host calls should be used to locate the process to attach
// to, and then this function should be called.
NativeProcessProtocol(lldb::pid_t pid, int terminal_fd,
NativeDelegate &delegate);
// -----------------------------------------------------------
// Internal interface for state handling
// ----------------------------------------------------------- Internal
// interface for state handling
// -----------------------------------------------------------
void SetState(lldb::StateType state, bool notify_delegates = true);
// Derived classes need not implement this. It can be used as a
// hook to clear internal caches that should be invalidated when
// stop ids change.
// Derived classes need not implement this. It can be used as a hook to
// clear internal caches that should be invalidated when stop ids change.
//
// Note this function is called with the state mutex obtained
// by the caller.
// Note this function is called with the state mutex obtained by the caller.
virtual void DoStopIDBumped(uint32_t newBumpId);
// -----------------------------------------------------------
// Internal interface for software breakpoints
// ----------------------------------------------------------- Internal
// interface for software breakpoints
// -----------------------------------------------------------
Status SetSoftwareBreakpoint(lldb::addr_t addr, uint32_t size_hint);

View File

@ -98,17 +98,14 @@ public:
virtual lldb::addr_t GetWatchpointAddress(uint32_t wp_index);
// MIPS Linux kernel returns a masked address (last 3bits are masked)
// when a HW watchpoint is hit. However user may not have set a watchpoint
// on this address. This function emulates the instruction at PC and
// finds the base address used in the load/store instruction. This gives the
// exact address used to read/write the variable being watched.
// For example:
// 'n' is at 0x120010d00 and 'm' is 0x120010d04. When a watchpoint is set at
// 'm',
// when a HW watchpoint is hit. However user may not have set a watchpoint on
// this address. This function emulates the instruction at PC and finds the
// base address used in the load/store instruction. This gives the exact
// address used to read/write the variable being watched. For example: 'n' is
// at 0x120010d00 and 'm' is 0x120010d04. When a watchpoint is set at 'm',
// then watch exception is generated even when 'n' is read/written. This
// function
// returns address of 'n' so that client can check whether a watchpoint is set
// on this address or not.
// function returns address of 'n' so that client can check whether a
// watchpoint is set on this address or not.
virtual lldb::addr_t GetWatchpointHitAddress(uint32_t wp_index);
virtual bool HardwareSingleStep(bool enable);

View File

@ -104,8 +104,8 @@ protected:
Predicate<uint16_t>
m_port_predicate; // Used when binding to port zero to wait for the thread
// that creates the socket, binds and listens to resolve
// the port number.
// that creates the socket, binds and listens to
// resolve the port number.
Pipe m_pipe;
std::recursive_mutex m_mutex;

View File

@ -74,8 +74,8 @@ public:
OptionArgVectorSP GetOptionArguments() const { return m_option_args_sp; }
const char *GetOptionString() { return m_option_string.c_str(); }
// this takes an alias - potentially nested (i.e. an alias to an alias)
// and expands it all the way to a non-alias command
// this takes an alias - potentially nested (i.e. an alias to an alias) and
// expands it all the way to a non-alias command
std::pair<lldb::CommandObjectSP, OptionArgVectorSP> Desugar();
protected:

View File

@ -29,9 +29,8 @@ class CommandCompletions {
public:
//----------------------------------------------------------------------
// This is the command completion callback that is used to complete the
// argument of the option
// it is bound to (in the OptionDefinition table below). Return the total
// number of matches.
// argument of the option it is bound to (in the OptionDefinition table
// below). Return the total number of matches.
//----------------------------------------------------------------------
typedef int (*CompletionCallback)(
CommandInterpreter &interpreter,
@ -54,9 +53,9 @@ public:
ePlatformPluginCompletion = (1u << 6),
eArchitectureCompletion = (1u << 7),
eVariablePathCompletion = (1u << 8),
// This item serves two purposes. It is the last element in the enum,
// so you can add custom enums starting from here in your Option class.
// Also if you & in this bit the base code will not process the option.
// This item serves two purposes. It is the last element in the enum, so
// you can add custom enums starting from here in your Option class. Also
// if you & in this bit the base code will not process the option.
eCustomCompletion = (1u << 9)
} CommonCompletionTypes;
@ -133,9 +132,8 @@ public:
lldb_private::StringList &matches);
//----------------------------------------------------------------------
// The Completer class is a convenient base class for building searchers
// that go along with the SearchFilter passed to the standard Completer
// functions.
// The Completer class is a convenient base class for building searchers that
// go along with the SearchFilter passed to the standard Completer functions.
//----------------------------------------------------------------------
class Completer : public Searcher {
public:

View File

@ -86,11 +86,10 @@ public:
m_add_to_history = value;
}
// These return the default behaviors if the behavior is not
// eLazyBoolCalculate.
// But I've also left the ivars public since for different ways of running the
// interpreter you might want to force different defaults... In that case,
// just grab
// the LazyBool ivars directly and do what you want with eLazyBoolCalculate.
// eLazyBoolCalculate. But I've also left the ivars public since for
// different ways of running the interpreter you might want to force
// different defaults... In that case, just grab the LazyBool ivars directly
// and do what you want with eLazyBoolCalculate.
bool GetStopOnContinue() const { return DefaultToNo(m_stop_on_continue); }
void SetStopOnContinue(bool stop_on_continue) {
@ -293,26 +292,19 @@ public:
CommandObject *GetCommandObjectForCommand(llvm::StringRef &command_line);
// This handles command line completion. You are given a pointer to the
// command string buffer, to the current cursor,
// and to the end of the string (in case it is not NULL terminated).
// You also passed in an StringList object to fill with the returns.
// The first element of the array will be filled with the string that you
// would need to insert at
// the cursor point to complete the cursor point to the longest common
// matching prefix.
// If you want to limit the number of elements returned, set
// max_return_elements to the number of elements
// you want returned. Otherwise set max_return_elements to -1.
// If you want to start some way into the match list, then set
// match_start_point to the desired start
// point.
// Returns:
// -1 if the completion character should be inserted
// -2 if the entire command line should be deleted and replaced with
// matches.GetStringAtIndex(0)
// command string buffer, to the current cursor, and to the end of the string
// (in case it is not NULL terminated). You also passed in an StringList
// object to fill with the returns. The first element of the array will be
// filled with the string that you would need to insert at the cursor point
// to complete the cursor point to the longest common matching prefix. If you
// want to limit the number of elements returned, set max_return_elements to
// the number of elements you want returned. Otherwise set
// max_return_elements to -1. If you want to start some way into the match
// list, then set match_start_point to the desired start point. Returns: -1
// if the completion character should be inserted -2 if the entire command
// line should be deleted and replaced with matches.GetStringAtIndex(0)
// INT_MAX if the number of matches is > max_return_elements, but it is
// expensive to compute.
// Otherwise, returns the number of matches.
// expensive to compute. Otherwise, returns the number of matches.
//
// FIXME: Only max_return_elements == -1 is supported at present.
int HandleCompletion(const char *current_line, const char *cursor,
@ -320,11 +312,10 @@ public:
int max_return_elements, StringList &matches);
// This version just returns matches, and doesn't compute the substring. It
// is here so the
// Help command can call it for the first argument.
// is here so the Help command can call it for the first argument.
// word_complete tells whether the completions are considered a "complete"
// response (so the
// completer should complete the quote & put a space after the word.
// response (so the completer should complete the quote & put a space after
// the word.
int HandleCompletionMatches(Args &input, int &cursor_index,
int &cursor_char_position, int match_start_point,
int max_return_elements, bool &word_complete,

View File

@ -32,9 +32,8 @@ namespace lldb_private {
// This function really deals with CommandObjectLists, but we didn't make a
// CommandObjectList class, so I'm sticking it here. But we really should have
// such a class. Anyway, it looks up the commands in the map that match the
// partial
// string cmd_str, inserts the matches into matches, and returns the number
// added.
// partial string cmd_str, inserts the matches into matches, and returns the
// number added.
template <typename ValueType>
int AddNamesMatchingPartialString(const std::map<std::string, ValueType> &in_map,
@ -138,8 +137,8 @@ public:
void SetSyntax(llvm::StringRef str);
// override this to return true if you want to enable the user to delete
// the Command object from the Command dictionary (aliases have their own
// override this to return true if you want to enable the user to delete the
// Command object from the Command dictionary (aliases have their own
// deletion scheme, so they do not need to care about this)
virtual bool IsRemovable() const { return false; }
@ -149,9 +148,9 @@ public:
virtual bool IsAlias() { return false; }
// override this to return true if your command is somehow a "dash-dash"
// form of some other command (e.g. po is expr -O --); this is a powerful
// hint to the help system that one cannot pass options to this command
// override this to return true if your command is somehow a "dash-dash" form
// of some other command (e.g. po is expr -O --); this is a powerful hint to
// the help system that one cannot pass options to this command
virtual bool IsDashDashCommand() { return false; }
virtual lldb::CommandObjectSP GetSubcommandSP(llvm::StringRef sub_cmd,
@ -175,10 +174,9 @@ public:
virtual void GenerateHelpText(Stream &result);
// this is needed in order to allow the SBCommand class to
// transparently try and load subcommands - it will fail on
// anything but a multiword command, but it avoids us doing
// type checkings and casts
// this is needed in order to allow the SBCommand class to transparently try
// and load subcommands - it will fail on anything but a multiword command,
// but it avoids us doing type checkings and casts
virtual bool LoadSubCommand(llvm::StringRef cmd_name,
const lldb::CommandObjectSP &command_obj) {
return false;
@ -186,9 +184,9 @@ public:
virtual bool WantsRawCommandString() = 0;
// By default, WantsCompletion = !WantsRawCommandString.
// Subclasses who want raw command string but desire, for example,
// argument completion should override this method to return true.
// By default, WantsCompletion = !WantsRawCommandString. Subclasses who want
// raw command string but desire, for example, argument completion should
// override this method to return true.
virtual bool WantsCompletion() { return !WantsRawCommandString(); }
virtual Options *GetOptions();
@ -210,10 +208,10 @@ public:
static const char *GetArgumentName(lldb::CommandArgumentType arg_type);
// Generates a nicely formatted command args string for help command output.
// By default, all possible args are taken into account, for example,
// '<expr | variable-name>'. This can be refined by passing a second arg
// specifying which option set(s) we are interested, which could then, for
// example, produce either '<expr>' or '<variable-name>'.
// By default, all possible args are taken into account, for example, '<expr
// | variable-name>'. This can be refined by passing a second arg specifying
// which option set(s) we are interested, which could then, for example,
// produce either '<expr>' or '<variable-name>'.
void GetFormattedCommandArguments(Stream &str,
uint32_t opt_set_mask = LLDB_OPT_SET_ALL);
@ -415,18 +413,16 @@ protected:
}
// This is for use in the command interpreter, when you either want the
// selected target, or if no target
// is present you want to prime the dummy target with entities that will be
// copied over to new targets.
// selected target, or if no target is present you want to prime the dummy
// target with entities that will be copied over to new targets.
Target *GetSelectedOrDummyTarget(bool prefer_dummy = false);
Target *GetDummyTarget();
// If a command needs to use the "current" thread, use this call.
// Command objects will have an ExecutionContext to use, and that may or may
// not have a thread in it. If it
// does, you should use that by default, if not, then use the
// ExecutionContext's target's selected thread, etc...
// This call insulates you from the details of this calculation.
// If a command needs to use the "current" thread, use this call. Command
// objects will have an ExecutionContext to use, and that may or may not have
// a thread in it. If it does, you should use that by default, if not, then
// use the ExecutionContext's target's selected thread, etc... This call
// insulates you from the details of this calculation.
Thread *GetDefaultThread();
//------------------------------------------------------------------

View File

@ -87,8 +87,8 @@ public:
~CommandObjectProxy() override;
// Subclasses must provide a command object that will be transparently
// used for this object.
// Subclasses must provide a command object that will be transparently used
// for this object.
virtual CommandObject *GetProxyCommandObject() = 0;
llvm::StringRef GetHelpLong() override;

View File

@ -24,9 +24,9 @@ namespace lldb_private {
class OptionGroupBoolean : public OptionGroup {
public:
// When 'no_argument_toggle_default' is true, then setting the option
// value does NOT require an argument, it sets the boolean value to the
// inverse of the default value
// When 'no_argument_toggle_default' is true, then setting the option value
// does NOT require an argument, it sets the boolean value to the inverse of
// the default value
OptionGroupBoolean(uint32_t usage_mask, bool required,
const char *long_option, int short_option,
const char *usage_text, bool default_value,

View File

@ -76,8 +76,8 @@ public:
//-----------------------------------------------------------------
virtual Type GetType() const = 0;
// If this value is always hidden, the avoid showing any info on this
// value, just show the info for the child values.
// If this value is always hidden, the avoid showing any info on this value,
// just show the info for the child values.
virtual bool ValueIsTransparent() const {
return GetType() == eTypeProperties;
}
@ -126,8 +126,8 @@ public:
virtual bool DumpQualifiedName(Stream &strm) const;
//-----------------------------------------------------------------
// Subclasses should NOT override these functions as they use the
// above functions to implement functionality
// Subclasses should NOT override these functions as they use the above
// functions to implement functionality
//-----------------------------------------------------------------
uint32_t GetTypeAsMask() { return 1u << GetType(); }
@ -183,9 +183,8 @@ public:
CreateValueFromCStringForTypeMask(const char *value_cstr, uint32_t type_mask,
Status &error);
// Get this value as a uint64_t value if it is encoded as a boolean,
// uint64_t or int64_t. Other types will cause "fail_value" to be
// returned
// Get this value as a uint64_t value if it is encoded as a boolean, uint64_t
// or int64_t. Other types will cause "fail_value" to be returned
uint64_t GetUInt64Value(uint64_t fail_value, bool *success_ptr);
OptionValueArch *GetAsArch();
@ -339,10 +338,10 @@ protected:
void *m_baton;
bool m_value_was_set; // This can be used to see if a value has been set
// by a call to SetValueFromCString(). It is often
// handy to know if an option value was set from
// the command line or as a setting, versus if we
// just have the default value that was already
// populated in the option value.
// handy to know if an option value was set from the
// command line or as a setting, versus if we just have
// the default value that was already populated in the
// option value.
};
} // namespace lldb_private

View File

@ -78,8 +78,8 @@ public:
}
bool AppendValue(const lldb::OptionValueSP &value_sp) {
// Make sure the value_sp object is allowed to contain
// values of the type passed in...
// Make sure the value_sp object is allowed to contain values of the type
// passed in...
if (value_sp && (m_type_mask & value_sp->GetTypeAsMask())) {
m_values.push_back(value_sp);
return true;
@ -88,8 +88,8 @@ public:
}
bool InsertValue(size_t idx, const lldb::OptionValueSP &value_sp) {
// Make sure the value_sp object is allowed to contain
// values of the type passed in...
// Make sure the value_sp object is allowed to contain values of the type
// passed in...
if (value_sp && (m_type_mask & value_sp->GetTypeAsMask())) {
if (idx < m_values.size())
m_values.insert(m_values.begin() + idx, value_sp);
@ -101,8 +101,8 @@ public:
}
bool ReplaceValue(size_t idx, const lldb::OptionValueSP &value_sp) {
// Make sure the value_sp object is allowed to contain
// values of the type passed in...
// Make sure the value_sp object is allowed to contain values of the type
// passed in...
if (value_sp && (m_type_mask & value_sp->GetTypeAsMask())) {
if (idx < m_values.size()) {
m_values[idx] = value_sp;

View File

@ -75,15 +75,15 @@ public:
//---------------------------------------------------------------------
// Get the index of a property given its exact name in this property
// collection, "name" can't be a path to a property path that refers
// to a property within a property
// collection, "name" can't be a path to a property path that refers to a
// property within a property
//---------------------------------------------------------------------
virtual uint32_t GetPropertyIndex(const ConstString &name) const;
//---------------------------------------------------------------------
// Get a property by exact name exists in this property collection, name
// can not be a path to a property path that refers to a property within
// a property
// Get a property by exact name exists in this property collection, name can
// not be a path to a property path that refers to a property within a
// property
//---------------------------------------------------------------------
virtual const Property *GetProperty(const ExecutionContext *exe_ctx,
bool will_modify,

View File

@ -34,9 +34,9 @@ public:
//---------------------------------------------------------------------
// Decode a uint64_t from "value_cstr" return a OptionValueUInt64 object
// inside of a lldb::OptionValueSP object if all goes well. If the
// string isn't a uint64_t value or any other error occurs, return an
// empty lldb::OptionValueSP and fill error in with the correct stuff.
// inside of a lldb::OptionValueSP object if all goes well. If the string
// isn't a uint64_t value or any other error occurs, return an empty
// lldb::OptionValueSP and fill error in with the correct stuff.
//---------------------------------------------------------------------
static lldb::OptionValueSP Create(const char *, Status &) = delete;
static lldb::OptionValueSP Create(llvm::StringRef value_str, Status &error);

View File

@ -92,9 +92,9 @@ public:
bool VerifyOptions(CommandReturnObject &result);
// Verify that the options given are in the options table and can
// be used together, but there may be some required options that are
// missing (used to verify options that get folded into command aliases).
// Verify that the options given are in the options table and can be used
// together, but there may be some required options that are missing (used to
// verify options that get folded into command aliases).
bool VerifyPartialOptions(CommandReturnObject &result);
void OutputFormattedUsageText(Stream &strm,
@ -106,18 +106,18 @@ public:
bool SupportsLongOption(const char *long_option);
// The following two pure virtual functions must be defined by every
// class that inherits from this class.
// The following two pure virtual functions must be defined by every class
// that inherits from this class.
virtual llvm::ArrayRef<OptionDefinition> GetDefinitions() {
return llvm::ArrayRef<OptionDefinition>();
}
// Call this prior to parsing any options. This call will call the
// subclass OptionParsingStarting() and will avoid the need for all
// Call this prior to parsing any options. This call will call the subclass
// OptionParsingStarting() and will avoid the need for all
// OptionParsingStarting() function instances from having to call the
// Option::OptionParsingStarting() like they did before. This was error
// prone and subclasses shouldn't have to do it.
// Option::OptionParsingStarting() like they did before. This was error prone
// and subclasses shouldn't have to do it.
void NotifyOptionParsingStarting(ExecutionContext *execution_context);
//------------------------------------------------------------------
@ -298,14 +298,14 @@ protected:
void OptionsSetUnion(const OptionSet &set_a, const OptionSet &set_b,
OptionSet &union_set);
// Subclasses must reset their option values prior to starting a new
// option parse. Each subclass must override this function and revert
// all option settings to default values.
// Subclasses must reset their option values prior to starting a new option
// parse. Each subclass must override this function and revert all option
// settings to default values.
virtual void OptionParsingStarting(ExecutionContext *execution_context) = 0;
virtual Status OptionParsingFinished(ExecutionContext *execution_context) {
// If subclasses need to know when the options are done being parsed
// they can implement this function to do extra checking
// If subclasses need to know when the options are done being parsed they
// can implement this function to do extra checking
Status error;
return error;
}
@ -326,8 +326,8 @@ public:
virtual void OptionParsingStarting(ExecutionContext *execution_context) = 0;
virtual Status OptionParsingFinished(ExecutionContext *execution_context) {
// If subclasses need to know when the options are done being parsed
// they can implement this function to do extra checking
// If subclasses need to know when the options are done being parsed they
// can implement this function to do extra checking
Status error;
return error;
}

View File

@ -403,8 +403,8 @@ public:
uint32_t GetRangeIndexContainingAddress(const Address &addr);
//------------------------------------------------------------------
// Since blocks might have multiple discontiguous address ranges,
// we need to be able to get at any of the address ranges in a block.
// Since blocks might have multiple discontiguous address ranges, we need to
// be able to get at any of the address ranges in a block.
//------------------------------------------------------------------
bool GetRangeAtIndex(uint32_t range_idx, AddressRange &range);

View File

@ -638,8 +638,7 @@ public:
//----------------------------------------------------------------------
// Using the current type, create a new typedef to that type using
// "typedef_name"
// as the name and "decl_ctx" as the decl context.
// "typedef_name" as the name and "decl_ctx" as the decl context.
static CompilerType
CreateTypedefType(const CompilerType &type, const char *typedef_name,
const CompilerDeclContext &compiler_decl_ctx);
@ -656,8 +655,7 @@ public:
GetFullyUnqualifiedType(lldb::opaque_compiler_type_t type) override;
// Returns -1 if this isn't a function of if the function doesn't have a
// prototype
// Returns a value >= 0 if there is a prototype.
// prototype Returns a value >= 0 if there is a prototype.
int GetFunctionArgumentCount(lldb::opaque_compiler_type_t type) override;
CompilerType GetFunctionArgumentTypeAtIndex(lldb::opaque_compiler_type_t type,
@ -769,8 +767,8 @@ public:
bool &child_is_base_class, bool &child_is_deref_of_parent,
ValueObject *valobj, uint64_t &language_flags) override;
// Lookup a child given a name. This function will match base class names
// and member member names in "clang_type" only, not descendants.
// Lookup a child given a name. This function will match base class names and
// member member names in "clang_type" only, not descendants.
uint32_t GetIndexOfChildWithName(lldb::opaque_compiler_type_t type,
const char *name,
bool omit_empty_base_classes) override;
@ -800,8 +798,8 @@ public:
CompilerType GetTypeForFormatters(void *type) override;
#define LLDB_INVALID_DECL_LEVEL UINT32_MAX
// LLDB_INVALID_DECL_LEVEL is returned by CountDeclLevels if
// child_decl_ctx could not be found in decl_ctx.
// LLDB_INVALID_DECL_LEVEL is returned by CountDeclLevels if child_decl_ctx
// could not be found in decl_ctx.
uint32_t CountDeclLevels(clang::DeclContext *frame_decl_ctx,
clang::DeclContext *child_decl_ctx,
ConstString *child_name = nullptr,
@ -892,13 +890,13 @@ public:
// Pointers & References
//------------------------------------------------------------------
// Call this function using the class type when you want to make a
// member pointer type to pointee_type.
// Call this function using the class type when you want to make a member
// pointer type to pointee_type.
static CompilerType CreateMemberPointerType(const CompilerType &type,
const CompilerType &pointee_type);
// Converts "s" to a floating point value and place resulting floating
// point bytes in the "dst" buffer.
// Converts "s" to a floating point value and place resulting floating point
// bytes in the "dst" buffer.
size_t ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
const char *s, uint8_t *dst,
size_t dst_size) override;

Some files were not shown because too many files have changed in this diff Show More