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 (); switch (level) { case lldb::eDescriptionLevelBrief: case lldb::eDescriptionLevelFull: if (num_locations > 0) { s->Printf(", locations = %zu", num_locations); if (num_resolved_locations > 0) s->Printf(", resolved = %zu", num_resolved_locations); } else { s->Printf(", locations = 0 (pending)"); } GetOptions()->GetDescription(s, level); if (level == lldb::eDescriptionLevelFull) { s->IndentLess(); s->EOL(); } break; case lldb::eDescriptionLevelVerbose: // Verbose mode does a debug dump of the breakpoint Dump (s); s->EOL (); s->Indent(); GetOptions()->GetDescription(s, level); break; default: break; } if (show_locations) { s->IndentMore(); for (size_t i = 0; i < num_locations; ++i) { BreakpointLocation *loc = GetLocationAtIndex(i).get(); loc->GetDescription(s, level); s->EOL(); } s->IndentLess(); } }
void Breakpoint::GetDescription(Stream *s, lldb::DescriptionLevel level, bool show_locations) { assert(s != nullptr); if (!m_kind_description.empty()) { if (level == eDescriptionLevelBrief) { s->PutCString(GetBreakpointKind()); return; } else s->Printf("Kind: %s\n", GetBreakpointKind()); } const size_t num_locations = GetNumLocations(); const size_t num_resolved_locations = GetNumResolvedLocations(); // 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: case lldb::eDescriptionLevelFull: if (num_locations > 0) { s->Printf(", locations = %" PRIu64, (uint64_t)num_locations); if (num_resolved_locations > 0) s->Printf(", resolved = %" PRIu64 ", hit count = %d", (uint64_t)num_resolved_locations, GetHitCount()); } else { // Don't print the pending notification for exception resolvers since we // don't generally // know how to set them until the target is run. if (m_resolver_sp->getResolverID() != BreakpointResolver::ExceptionResolver) s->Printf(", locations = 0 (pending)"); } GetOptions()->GetDescription(s, level); if (m_precondition_sp) m_precondition_sp->GetDescription(*s, level); if (level == lldb::eDescriptionLevelFull) { if (!m_name_list.empty()) { s->EOL(); s->Indent(); s->Printf("Names:"); s->EOL(); s->IndentMore(); for (std::string name : m_name_list) { s->Indent(); s->Printf("%s\n", name.c_str()); } s->IndentLess(); } s->IndentLess(); 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 && !show_locations) { // There is only one location, so we'll just print that location // information. GetLocationAtIndex(0)->GetDescription(s, level); } else { s->Printf("%" PRIu64 " locations.", static_cast<uint64_t>(num_locations)); } s->EOL(); break; case lldb::eDescriptionLevelVerbose: // Verbose mode does a debug dump of the breakpoint Dump(s); s->EOL(); // s->Indent(); GetOptions()->GetDescription(s, level); break; default: break; } // The brief description is just the location name (1.2 or whatever). That's // pointless to // show in the breakpoint's description, so suppress it. if (show_locations && level != lldb::eDescriptionLevelBrief) { s->IndentMore(); for (size_t i = 0; i < num_locations; ++i) { BreakpointLocation *loc = GetLocationAtIndex(i).get(); loc->GetDescription(s, level); s->EOL(); } s->IndentLess(); } }
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 (); switch (level) { case lldb::eDescriptionLevelBrief: case lldb::eDescriptionLevelFull: if (num_locations > 0) { s->Printf(", locations = %zu", num_locations); if (num_resolved_locations > 0) s->Printf(", resolved = %zu", num_resolved_locations); } else { // Don't print the pending notification for exception resolvers since we don't generally // know how to set them until the target is run. if (m_resolver_sp->getResolverID() != BreakpointResolver::ExceptionResolver) s->Printf(", locations = 0 (pending)"); } GetOptions()->GetDescription(s, level); if (level == lldb::eDescriptionLevelFull) { s->IndentLess(); s->EOL(); } break; case lldb::eDescriptionLevelVerbose: // Verbose mode does a debug dump of the breakpoint Dump (s); s->EOL (); //s->Indent(); GetOptions()->GetDescription(s, level); break; default: break; } // The brief description is just the location name (1.2 or whatever). That's pointless to // show in the breakpoint's description, so suppress it. if (show_locations && level != lldb::eDescriptionLevelBrief) { s->IndentMore(); for (size_t i = 0; i < num_locations; ++i) { BreakpointLocation *loc = GetLocationAtIndex(i).get(); loc->GetDescription(s, level); s->EOL(); } s->IndentLess(); } }
void Breakpoint::GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_locations) { 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: case lldb::eDescriptionLevelFull: if (num_locations > 0) { s->Printf(", locations = %" PRIu64, (uint64_t)num_locations); if (num_resolved_locations > 0) s->Printf(", resolved = %" PRIu64, (uint64_t)num_resolved_locations); } else { // Don't print the pending notification for exception resolvers since we don't generally // know how to set them until the target is run. if (m_resolver_sp->getResolverID() != BreakpointResolver::ExceptionResolver) s->Printf(", locations = 0 (pending)"); } GetOptions()->GetDescription(s, level); if (level == lldb::eDescriptionLevelFull) { s->IndentLess(); 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); s->EOL (); //s->Indent(); GetOptions()->GetDescription(s, level); break; default: break; } // The brief description is just the location name (1.2 or whatever). That's pointless to // show in the breakpoint's description, so suppress it. if (show_locations && level != lldb::eDescriptionLevelBrief) { s->IndentMore(); for (size_t i = 0; i < num_locations; ++i) { BreakpointLocation *loc = GetLocationAtIndex(i).get(); loc->GetDescription(s, level); s->EOL(); } s->IndentLess(); } }