summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Breakpoint/Breakpoint.cpp45
-rw-r--r--lldb/source/Breakpoint/BreakpointLocation.cpp30
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.cpp5
3 files changed, 63 insertions, 17 deletions
diff --git a/lldb/source/Breakpoint/Breakpoint.cpp b/lldb/source/Breakpoint/Breakpoint.cpp
index e1582585078..e90a827fdba 100644
--- a/lldb/source/Breakpoint/Breakpoint.cpp
+++ b/lldb/source/Breakpoint/Breakpoint.cpp
@@ -511,14 +511,22 @@ Breakpoint::GetNumLocations() const
void
Breakpoint::GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_locations)
{
- assert (s != NULL);
- s->Printf("%i: ", GetID());
- GetResolverDescription (s);
- GetFilterDescription (s);
-
const size_t num_locations = GetNumLocations ();
const size_t num_resolved_locations = GetNumResolvedLocations ();
+ assert (s != NULL);
+
+
+
+ // They just made the breakpoint, they don't need to be told HOW they made it...
+ // Also, we'll print the breakpoint number differently depending on whether there is 1 or more locations.
+ if (level != eDescriptionLevelInitial)
+ {
+ s->Printf("%i: ", GetID());
+ GetResolverDescription (s);
+ GetFilterDescription (s);
+ }
+
switch (level)
{
case lldb::eDescriptionLevelBrief:
@@ -545,7 +553,32 @@ Breakpoint::GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_l
s->EOL();
}
break;
-
+
+ case lldb::eDescriptionLevelInitial:
+ s->Printf ("Breakpoint %i: ", GetID());
+ if (num_locations == 0)
+ {
+ s->Printf ("no locations (pending).");
+ }
+ else if (num_locations == 1)
+ {
+ // If there is one location only, we'll just print that location information. But don't do this if
+ // show locations is true, then that will be handled below.
+ if (show_locations == false)
+ {
+ GetLocationAtIndex(0)->GetDescription(s, level);
+ }
+ else
+ {
+ s->Printf ("%zd locations.", num_locations);
+ }
+ }
+ else
+ {
+ s->Printf ("%zd locations.", num_locations);
+ }
+ s->EOL();
+ break;
case lldb::eDescriptionLevelVerbose:
// Verbose mode does a debug dump of the breakpoint
Dump (s);
diff --git a/lldb/source/Breakpoint/BreakpointLocation.cpp b/lldb/source/Breakpoint/BreakpointLocation.cpp
index 96ccce37ee6..202898c19ab 100644
--- a/lldb/source/Breakpoint/BreakpointLocation.cpp
+++ b/lldb/source/Breakpoint/BreakpointLocation.cpp
@@ -410,13 +410,20 @@ void
BreakpointLocation::GetDescription (Stream *s, lldb::DescriptionLevel level)
{
SymbolContext sc;
- s->Indent();
- BreakpointID::GetCanonicalReference(s, m_owner.GetID(), GetID());
-
+
+ // If the description level is "initial" then the breakpoint is printing out our initial state,
+ // and we should let it decide how it wants to print our label.
+ if (level != eDescriptionLevelInitial)
+ {
+ s->Indent();
+ BreakpointID::GetCanonicalReference(s, m_owner.GetID(), GetID());
+ }
+
if (level == lldb::eDescriptionLevelBrief)
return;
- s->PutCString(": ");
+ if (level != eDescriptionLevelInitial)
+ s->PutCString(": ");
if (level == lldb::eDescriptionLevelVerbose)
s->IndentMore();
@@ -425,7 +432,7 @@ BreakpointLocation::GetDescription (Stream *s, lldb::DescriptionLevel level)
{
m_address.CalculateSymbolContext(&sc);
- if (level == lldb::eDescriptionLevelFull)
+ if (level == lldb::eDescriptionLevelFull || level == eDescriptionLevelInitial)
{
s->PutCString("where = ");
sc.DumpStopContext (s, m_owner.GetTarget().GetProcessSP().get(), m_address, false, true, false);
@@ -478,7 +485,11 @@ BreakpointLocation::GetDescription (Stream *s, lldb::DescriptionLevel level)
s->EOL();
s->Indent();
}
- s->Printf ("%saddress = ", (level == lldb::eDescriptionLevelFull && m_address.IsSectionOffset()) ? ", " : "");
+
+ if (m_address.IsSectionOffset() && (level == eDescriptionLevelFull || level == eDescriptionLevelInitial))
+ s->Printf (", ");
+ s->Printf ("address = ");
+
ExecutionContextScope *exe_scope = NULL;
Target *target = &m_owner.GetTarget();
if (target)
@@ -486,7 +497,10 @@ BreakpointLocation::GetDescription (Stream *s, lldb::DescriptionLevel level)
if (exe_scope == NULL)
exe_scope = target;
- m_address.Dump(s, exe_scope, Address::DumpStyleLoadAddress, Address::DumpStyleModuleWithFileAddress);
+ if (eDescriptionLevelInitial)
+ m_address.Dump(s, exe_scope, Address::DumpStyleLoadAddress, Address::DumpStyleFileAddress);
+ else
+ m_address.Dump(s, exe_scope, Address::DumpStyleLoadAddress, Address::DumpStyleModuleWithFileAddress);
if (level == lldb::eDescriptionLevelVerbose)
{
@@ -505,7 +519,7 @@ BreakpointLocation::GetDescription (Stream *s, lldb::DescriptionLevel level)
}
s->IndentLess();
}
- else
+ else if (level != eDescriptionLevelInitial)
{
s->Printf(", %sresolved, hit count = %u ",
(IsResolved() ? "" : "un"),
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 95d533da5f5..0bc02d8b53f 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -516,9 +516,8 @@ protected:
if (bp)
{
Stream &output_stream = result.GetOutputStream();
- output_stream.Printf ("Breakpoint created: ");
- bp->GetDescription(&output_stream, lldb::eDescriptionLevelBrief);
- output_stream.EOL();
+ const bool show_locations = false;
+ bp->GetDescription(&output_stream, lldb::eDescriptionLevelInitial, show_locations);
// Don't print out this warning for exception breakpoints. They can get set before the target
// is set, but we won't know how to actually set the breakpoint till we run.
if (bp->GetNumLocations() == 0 && break_type != eSetTypeException)
OpenPOWER on IntegriCloud