diff options
| author | Raphael Isemann <teemperor@gmail.com> | 2019-12-05 14:41:09 +0100 |
|---|---|---|
| committer | Raphael Isemann <teemperor@gmail.com> | 2019-12-05 14:41:33 +0100 |
| commit | 1462f5a4c138bb20f38a579a29d12ab4e5fb6191 (patch) | |
| tree | 38e08e27e5d8ec3843f65f9e09940d3635f69428 /lldb/source/Target | |
| parent | 18b72d337ef31bc4f1b898ceb17796ffe12dd104 (diff) | |
| download | bcm5719-llvm-1462f5a4c138bb20f38a579a29d12ab4e5fb6191.tar.gz bcm5719-llvm-1462f5a4c138bb20f38a579a29d12ab4e5fb6191.zip | |
[lldb][NFC] Move Address and AddressRange functions out of Stream and let them take raw_ostream
Summary:
Yet another step on the long road towards getting rid of lldb's Stream class.
We probably should just make this some kind of member of Address/AddressRange, but it seems quite often we just push
in random integers in there and this is just about getting rid of Stream and not improving arbitrary APIs.
I had to rename another `DumpAddress` function in FormatEntity that is dumping the content of an address to make Clang happy.
Reviewers: labath
Reviewed By: labath
Subscribers: JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71052
Diffstat (limited to 'lldb/source/Target')
| -rw-r--r-- | lldb/source/Target/ThreadPlanRunToAddress.cpp | 6 | ||||
| -rw-r--r-- | lldb/source/Target/ThreadPlanStepInRange.cpp | 4 | ||||
| -rw-r--r-- | lldb/source/Target/ThreadPlanStepInstruction.cpp | 16 | ||||
| -rw-r--r-- | lldb/source/Target/ThreadPlanStepOverRange.cpp | 4 | ||||
| -rw-r--r-- | lldb/source/Target/ThreadPlanStepThrough.cpp | 4 |
5 files changed, 18 insertions, 16 deletions
diff --git a/lldb/source/Target/ThreadPlanRunToAddress.cpp b/lldb/source/Target/ThreadPlanRunToAddress.cpp index 160743a9f3f..32ea2e67527 100644 --- a/lldb/source/Target/ThreadPlanRunToAddress.cpp +++ b/lldb/source/Target/ThreadPlanRunToAddress.cpp @@ -97,7 +97,7 @@ void ThreadPlanRunToAddress::GetDescription(Stream *s, s->Printf("run to addresses: "); for (size_t i = 0; i < num_addresses; i++) { - s->Address(m_addresses[i], sizeof(addr_t)); + DumpAddress(s->AsRawOstream(), m_addresses[i], sizeof(addr_t)); s->Printf(" "); } } else { @@ -116,7 +116,7 @@ void ThreadPlanRunToAddress::GetDescription(Stream *s, s->Indent(); } - s->Address(m_addresses[i], sizeof(addr_t)); + DumpAddress(s->AsRawOstream(), m_addresses[i], sizeof(addr_t)); s->Printf(" using breakpoint: %d - ", m_break_ids[i]); Breakpoint *breakpoint = m_thread.CalculateTarget()->GetBreakpointByID(m_break_ids[i]).get(); @@ -143,7 +143,7 @@ bool ThreadPlanRunToAddress::ValidatePlan(Stream *error) { all_bps_good = false; if (error) { error->Printf("Could not set breakpoint for address: "); - error->Address(m_addresses[i], sizeof(addr_t)); + DumpAddress(error->AsRawOstream(), m_addresses[i], sizeof(addr_t)); error->Printf("\n"); } } diff --git a/lldb/source/Target/ThreadPlanStepInRange.cpp b/lldb/source/Target/ThreadPlanStepInRange.cpp index fdb2782bc51..ab1f6a21a86 100644 --- a/lldb/source/Target/ThreadPlanStepInRange.cpp +++ b/lldb/source/Target/ThreadPlanStepInRange.cpp @@ -145,8 +145,8 @@ bool ThreadPlanStepInRange::ShouldStop(Event *event_ptr) { if (log) { StreamString s; - s.Address( - m_thread.GetRegisterContext()->GetPC(), + DumpAddress( + s.AsRawOstream(), m_thread.GetRegisterContext()->GetPC(), m_thread.CalculateTarget()->GetArchitecture().GetAddressByteSize()); LLDB_LOGF(log, "ThreadPlanStepInRange reached %s.", s.GetData()); } diff --git a/lldb/source/Target/ThreadPlanStepInstruction.cpp b/lldb/source/Target/ThreadPlanStepInstruction.cpp index 0c75cb81115..afcc9d608b2 100644 --- a/lldb/source/Target/ThreadPlanStepInstruction.cpp +++ b/lldb/source/Target/ThreadPlanStepInstruction.cpp @@ -65,7 +65,7 @@ void ThreadPlanStepInstruction::GetDescription(Stream *s, PrintFailureIfAny(); } else { s->Printf("Stepping one instruction past "); - s->Address(m_instruction_addr, sizeof(addr_t)); + DumpAddress(s->AsRawOstream(), m_instruction_addr, sizeof(addr_t)); if (!m_start_has_symbol) s->Printf(" which has no symbol"); @@ -182,14 +182,16 @@ bool ThreadPlanStepInstruction::ShouldStop(Event *event_ptr) { s.PutCString("Stepped in to: "); addr_t stop_addr = m_thread.GetStackFrameAtIndex(0)->GetRegisterContext()->GetPC(); - s.Address(stop_addr, m_thread.CalculateTarget() - ->GetArchitecture() - .GetAddressByteSize()); + DumpAddress(s.AsRawOstream(), stop_addr, + m_thread.CalculateTarget() + ->GetArchitecture() + .GetAddressByteSize()); s.PutCString(" stepping out to: "); addr_t return_addr = return_frame->GetRegisterContext()->GetPC(); - s.Address(return_addr, m_thread.CalculateTarget() - ->GetArchitecture() - .GetAddressByteSize()); + DumpAddress(s.AsRawOstream(), return_addr, + m_thread.CalculateTarget() + ->GetArchitecture() + .GetAddressByteSize()); LLDB_LOGF(log, "%s.", s.GetData()); } diff --git a/lldb/source/Target/ThreadPlanStepOverRange.cpp b/lldb/source/Target/ThreadPlanStepOverRange.cpp index 2de678597c8..3dc1967e6d4 100644 --- a/lldb/source/Target/ThreadPlanStepOverRange.cpp +++ b/lldb/source/Target/ThreadPlanStepOverRange.cpp @@ -128,8 +128,8 @@ bool ThreadPlanStepOverRange::ShouldStop(Event *event_ptr) { if (log) { StreamString s; - s.Address( - m_thread.GetRegisterContext()->GetPC(), + DumpAddress( + s.AsRawOstream(), m_thread.GetRegisterContext()->GetPC(), m_thread.CalculateTarget()->GetArchitecture().GetAddressByteSize()); LLDB_LOGF(log, "ThreadPlanStepOverRange reached %s.", s.GetData()); } diff --git a/lldb/source/Target/ThreadPlanStepThrough.cpp b/lldb/source/Target/ThreadPlanStepThrough.cpp index 92b7fce1bc9..8c7b180fce2 100644 --- a/lldb/source/Target/ThreadPlanStepThrough.cpp +++ b/lldb/source/Target/ThreadPlanStepThrough.cpp @@ -119,11 +119,11 @@ void ThreadPlanStepThrough::GetDescription(Stream *s, s->Printf("Step through"); else { s->PutCString("Stepping through trampoline code from: "); - s->Address(m_start_address, sizeof(addr_t)); + DumpAddress(s->AsRawOstream(), m_start_address, sizeof(addr_t)); if (m_backstop_bkpt_id != LLDB_INVALID_BREAK_ID) { s->Printf(" with backstop breakpoint ID: %d at address: ", m_backstop_bkpt_id); - s->Address(m_backstop_addr, sizeof(addr_t)); + DumpAddress(s->AsRawOstream(), m_backstop_addr, sizeof(addr_t)); } else s->PutCString(" unable to set a backstop breakpoint."); } |

