mohit.bhakkad created this revision.
mohit.bhakkad added reviewers: clayborg, granata.enrico.
mohit.bhakkad added subscribers: jaydeep, bhushan, sagar, nitesh.jain,
lldb-commits.
mohit.bhakkad set the repository for this revision to rL LLVM.
Consider a vector variable 'v8i16 s0'
Right now if we print value of s0, it gives us proper value:
(lldb) print s0
(v8i16) $0 = (member 1, member 2, ........,member 8)
But if we try to set a watchpoint on it, it shows null for its value:
(lldb) watchpoint set variable s0
Watchpoint created: Watchpoint 1: addr = <addr> size = 16 state = enabled type
= w
declare @ 'file_name:line_no'
watchpoint spec = 's0'
new value: (null)
Approach used in patch is already used in in function
ValueObjectPrinter::GetValueSummaryError,
which is called for command 'print s0'.
Repository:
rL LLVM
http://reviews.llvm.org/D13202
Files:
source/Breakpoint/Watchpoint.cpp
Index: source/Breakpoint/Watchpoint.cpp
===================================================================
--- source/Breakpoint/Watchpoint.cpp
+++ source/Breakpoint/Watchpoint.cpp
@@ -218,14 +218,21 @@
s->Printf("\nWatchpoint %u hit:", GetID());
prefix = "";
}
-
+
if (m_old_value_sp)
{
- s->Printf("\n%sold value: %s", prefix,
m_old_value_sp->GetValueAsCString());
+ if (m_old_value_sp->GetValueAsCString())
+ s->Printf("\n%sold value: %s", prefix,
m_old_value_sp->GetValueAsCString());
+ else
+ s->Printf("\n%sold value: %s", prefix,
m_old_value_sp->GetSummaryAsCString());
}
+
if (m_new_value_sp)
{
- s->Printf("\n%snew value: %s", prefix,
m_new_value_sp->GetValueAsCString());
+ if (m_new_value_sp->GetValueAsCString())
+ s->Printf("\n%snew value: %s", prefix,
m_new_value_sp->GetValueAsCString());
+ else
+ s->Printf("\n%snew value: %s", prefix,
m_new_value_sp->GetSummaryAsCString());
}
}
Index: source/Breakpoint/Watchpoint.cpp
===================================================================
--- source/Breakpoint/Watchpoint.cpp
+++ source/Breakpoint/Watchpoint.cpp
@@ -218,14 +218,21 @@
s->Printf("\nWatchpoint %u hit:", GetID());
prefix = "";
}
-
+
if (m_old_value_sp)
{
- s->Printf("\n%sold value: %s", prefix, m_old_value_sp->GetValueAsCString());
+ if (m_old_value_sp->GetValueAsCString())
+ s->Printf("\n%sold value: %s", prefix, m_old_value_sp->GetValueAsCString());
+ else
+ s->Printf("\n%sold value: %s", prefix, m_old_value_sp->GetSummaryAsCString());
}
+
if (m_new_value_sp)
{
- s->Printf("\n%snew value: %s", prefix, m_new_value_sp->GetValueAsCString());
+ if (m_new_value_sp->GetValueAsCString())
+ s->Printf("\n%snew value: %s", prefix, m_new_value_sp->GetValueAsCString());
+ else
+ s->Printf("\n%snew value: %s", prefix, m_new_value_sp->GetSummaryAsCString());
}
}
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits