aboutsummaryrefslogtreecommitdiff
path: root/source/Breakpoint
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-09-16 21:41:42 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-09-16 21:41:42 +0000
commit10b12b3aa8542721fa9485c1d520433de0e0e720 (patch)
treebf44a0bff94ffb9deabf036a74edaaa416d87374 /source/Breakpoint
parent6a451485d71f890635a32930d09c7296e665bcbd (diff)
downloadlldb-10b12b3aa8542721fa9485c1d520433de0e0e720.tar.gz
Add a declaraion info member field to the WatchpointLocation class.
Modify CommandObjectFrame.cpp to populate this field when creating a watchpoint location. Update the test case to verify that the declaration info matches the file and line number. git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139946 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'source/Breakpoint')
-rw-r--r--source/Breakpoint/WatchpointLocation.cpp46
-rw-r--r--source/Breakpoint/WatchpointLocationList.cpp8
2 files changed, 41 insertions, 13 deletions
diff --git a/source/Breakpoint/WatchpointLocation.cpp b/source/Breakpoint/WatchpointLocation.cpp
index 3a78290cc..b4b9441c9 100644
--- a/source/Breakpoint/WatchpointLocation.cpp
+++ b/source/Breakpoint/WatchpointLocation.cpp
@@ -50,6 +50,13 @@ WatchpointLocation::SetCallback (WatchpointHitCallback callback, void *callback_
return true;
}
+void
+WatchpointLocation::SetDeclInfo (std::string &str)
+{
+ m_decl_str = str;
+ return;
+}
+
// RETURNS - true if we should stop at this breakpoint, false if we
// should continue.
@@ -75,27 +82,42 @@ void
WatchpointLocation::GetDescription (Stream *s, lldb::DescriptionLevel level)
{
s->Printf(" ");
- Dump(s);
+ DumpWithLevel(s, level);
return;
}
void
WatchpointLocation::Dump(Stream *s) const
{
+ DumpWithLevel(s, lldb::eDescriptionLevelBrief);
+}
+
+void
+WatchpointLocation::DumpWithLevel(Stream *s, lldb::DescriptionLevel description_level) const
+{
if (s == NULL)
return;
- s->Printf("WatchpointLocation %u: addr = 0x%8.8llx size = %zu state = %s type = %s%s hit_count = %-4u ignore_count = %-4u callback = %8p baton = %8p",
- GetID(),
- (uint64_t)m_addr,
- m_byte_size,
- m_enabled ? "enabled " : "disabled",
- m_watch_read ? "r" : "",
- m_watch_write ? "w" : "",
- GetHitCount(),
- GetIgnoreCount(),
- m_callback,
- m_callback_baton);
+ assert(description_level >= lldb::eDescriptionLevelBrief &&
+ description_level <= lldb::eDescriptionLevelVerbose);
+
+ s->Printf("WatchpointLocation %u: addr = 0x%8.8llx size = %zu state = %s type = %s%s",
+ GetID(),
+ (uint64_t)m_addr,
+ m_byte_size,
+ m_enabled ? "enabled" : "disabled",
+ m_watch_read ? "r" : "",
+ m_watch_write ? "w" : "");
+
+ if (description_level >= lldb::eDescriptionLevelFull)
+ s->Printf("\n declare @ '%s'", m_decl_str.c_str());
+
+ if (description_level >= lldb::eDescriptionLevelVerbose)
+ s->Printf("\n hit_count = %-4u ignore_count = %-4u callback = %8p baton = %8p",
+ GetHitCount(),
+ GetIgnoreCount(),
+ m_callback,
+ m_callback_baton);
}
bool
diff --git a/source/Breakpoint/WatchpointLocationList.cpp b/source/Breakpoint/WatchpointLocationList.cpp
index b6c773ff9..9227192ff 100644
--- a/source/Breakpoint/WatchpointLocationList.cpp
+++ b/source/Breakpoint/WatchpointLocationList.cpp
@@ -54,6 +54,12 @@ WatchpointLocationList::Add (const WatchpointLocationSP &wp_loc_sp)
void
WatchpointLocationList::Dump (Stream *s) const
{
+ DumpWithLevel(s, lldb::eDescriptionLevelBrief);
+}
+
+void
+WatchpointLocationList::DumpWithLevel (Stream *s, lldb::DescriptionLevel description_level) const
+{
Mutex::Locker locker (m_mutex);
s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
//s->Indent();
@@ -62,7 +68,7 @@ WatchpointLocationList::Dump (Stream *s) const
s->IndentMore();
addr_map::const_iterator pos, end = m_address_to_location.end();
for (pos = m_address_to_location.begin(); pos != end; ++pos)
- pos->second->Dump(s);
+ pos->second->DumpWithLevel(s, description_level);
s->IndentLess();
}