aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
diff options
context:
space:
mode:
authorKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
committerKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
commitb9c1b51e45b845debb76d8658edabca70ca56079 (patch)
treedfcb5a13ef2b014202340f47036da383eaee74aa /lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
parentd5aa73376966339caad04013510626ec2e42c760 (diff)
downloadllvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip
llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz
llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.bz2
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
Diffstat (limited to 'lldb/source/Breakpoint/BreakpointResolverFileLine.cpp')
-rw-r--r--lldb/source/Breakpoint/BreakpointResolverFileLine.cpp145
1 files changed, 61 insertions, 84 deletions
diff --git a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
index e1fb87a..482b165 100644
--- a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
+++ b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
@@ -26,102 +26,79 @@ using namespace lldb_private;
//----------------------------------------------------------------------
// BreakpointResolverFileLine:
//----------------------------------------------------------------------
-BreakpointResolverFileLine::BreakpointResolverFileLine
-(
- Breakpoint *bkpt,
- const FileSpec &file_spec,
- uint32_t line_no,
- lldb::addr_t offset,
- bool check_inlines,
- bool skip_prologue,
- bool exact_match
-) :
- BreakpointResolver (bkpt, BreakpointResolver::FileLineResolver, offset),
- m_file_spec (file_spec),
- m_line_number (line_no),
- m_inlines (check_inlines),
- m_skip_prologue(skip_prologue),
- m_exact_match(exact_match)
-{
-}
+BreakpointResolverFileLine::BreakpointResolverFileLine(
+ Breakpoint *bkpt, const FileSpec &file_spec, uint32_t line_no,
+ lldb::addr_t offset, bool check_inlines, bool skip_prologue,
+ bool exact_match)
+ : BreakpointResolver(bkpt, BreakpointResolver::FileLineResolver, offset),
+ m_file_spec(file_spec), m_line_number(line_no), m_inlines(check_inlines),
+ m_skip_prologue(skip_prologue), m_exact_match(exact_match) {}
-BreakpointResolverFileLine::~BreakpointResolverFileLine ()
-{
-}
+BreakpointResolverFileLine::~BreakpointResolverFileLine() {}
Searcher::CallbackReturn
-BreakpointResolverFileLine::SearchCallback
-(
- SearchFilter &filter,
- SymbolContext &context,
- Address *addr,
- bool containing
-)
-{
- SymbolContextList sc_list;
-
- assert (m_breakpoint != NULL);
-
- // There is a tricky bit here. You can have two compilation units that #include the same file, and
- // in one of them the function at m_line_number is used (and so code and a line entry for it is generated) but in the
- // other it isn't. If we considered the CU's independently, then in the second inclusion, we'd move the breakpoint
- // to the next function that actually generated code in the header file. That would end up being confusing.
- // So instead, we do the CU iterations by hand here, then scan through the complete list of matches, and figure out
- // the closest line number match, and only set breakpoints on that match.
-
- // Note also that if file_spec only had a file name and not a directory, there may be many different file spec's in
- // the resultant list. The closest line match for one will not be right for some totally different file.
- // So we go through the match list and pull out the sets that have the same file spec in their line_entry
- // and treat each set separately.
-
- const size_t num_comp_units = context.module_sp->GetNumCompileUnits();
- for (size_t i = 0; i < num_comp_units; i++)
- {
- CompUnitSP cu_sp (context.module_sp->GetCompileUnitAtIndex (i));
- if (cu_sp)
- {
- if (filter.CompUnitPasses(*cu_sp))
- cu_sp->ResolveSymbolContext (m_file_spec, m_line_number, m_inlines, m_exact_match, eSymbolContextEverything, sc_list);
- }
+BreakpointResolverFileLine::SearchCallback(SearchFilter &filter,
+ SymbolContext &context,
+ Address *addr, bool containing) {
+ SymbolContextList sc_list;
+
+ assert(m_breakpoint != NULL);
+
+ // There is a tricky bit here. You can have two compilation units that
+ // #include the same file, and
+ // in one of them the function at m_line_number is used (and so code and a
+ // line entry for it is generated) but in the
+ // other it isn't. If we considered the CU's independently, then in the
+ // second inclusion, we'd move the breakpoint
+ // to the next function that actually generated code in the header file. That
+ // would end up being confusing.
+ // So instead, we do the CU iterations by hand here, then scan through the
+ // complete list of matches, and figure out
+ // the closest line number match, and only set breakpoints on that match.
+
+ // Note also that if file_spec only had a file name and not a directory, there
+ // may be many different file spec's in
+ // the resultant list. The closest line match for one will not be right for
+ // some totally different file.
+ // So we go through the match list and pull out the sets that have the same
+ // file spec in their line_entry
+ // and treat each set separately.
+
+ const size_t num_comp_units = context.module_sp->GetNumCompileUnits();
+ for (size_t i = 0; i < num_comp_units; i++) {
+ CompUnitSP cu_sp(context.module_sp->GetCompileUnitAtIndex(i));
+ if (cu_sp) {
+ if (filter.CompUnitPasses(*cu_sp))
+ cu_sp->ResolveSymbolContext(m_file_spec, m_line_number, m_inlines,
+ m_exact_match, eSymbolContextEverything,
+ sc_list);
}
- StreamString s;
- s.Printf ("for %s:%d ",
- m_file_spec.GetFilename().AsCString("<Unknown>"),
- m_line_number);
+ }
+ StreamString s;
+ s.Printf("for %s:%d ", m_file_spec.GetFilename().AsCString("<Unknown>"),
+ m_line_number);
- SetSCMatchesByLine (filter, sc_list, m_skip_prologue, s.GetData());
+ SetSCMatchesByLine(filter, sc_list, m_skip_prologue, s.GetData());
- return Searcher::eCallbackReturnContinue;
+ return Searcher::eCallbackReturnContinue;
}
-Searcher::Depth
-BreakpointResolverFileLine::GetDepth()
-{
- return Searcher::eDepthModule;
+Searcher::Depth BreakpointResolverFileLine::GetDepth() {
+ return Searcher::eDepthModule;
}
-void
-BreakpointResolverFileLine::GetDescription (Stream *s)
-{
- s->Printf ("file = '%s', line = %u, exact_match = %d", m_file_spec.GetPath().c_str(), m_line_number, m_exact_match);
+void BreakpointResolverFileLine::GetDescription(Stream *s) {
+ s->Printf("file = '%s', line = %u, exact_match = %d",
+ m_file_spec.GetPath().c_str(), m_line_number, m_exact_match);
}
-void
-BreakpointResolverFileLine::Dump (Stream *s) const
-{
-
-}
+void BreakpointResolverFileLine::Dump(Stream *s) const {}
lldb::BreakpointResolverSP
-BreakpointResolverFileLine::CopyForBreakpoint (Breakpoint &breakpoint)
-{
- lldb::BreakpointResolverSP ret_sp(new BreakpointResolverFileLine(&breakpoint,
- m_file_spec,
- m_line_number,
- m_offset,
- m_inlines,
- m_skip_prologue,
- m_exact_match));
-
- return ret_sp;
+BreakpointResolverFileLine::CopyForBreakpoint(Breakpoint &breakpoint) {
+ lldb::BreakpointResolverSP ret_sp(new BreakpointResolverFileLine(
+ &breakpoint, m_file_spec, m_line_number, m_offset, m_inlines,
+ m_skip_prologue, m_exact_match));
+
+ return ret_sp;
}