Commit 0135cda6 authored by Tim van der Lippe's avatar Tim van der Lippe Committed by V8 LUCI CQ

Add more debugging info for DCHECK

We recently ran into two separate issues with this DCHECK. To enhance
debugging, let's add some more information as to which property is
failing. That should make investigating of the problematic property
easier, as we now no longer need to printf the results.

R=jkummerow@chromium.org

Bug: chromium:1276617, chromium:1262066
Change-Id: I8613780fc9613af700e113bb6050d4cbbd4cb040
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3330467
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78353}
parent 282e6788
...@@ -124,7 +124,15 @@ v8::Maybe<v8::PropertyAttribute> DebugPropertyIterator::attributes() { ...@@ -124,7 +124,15 @@ v8::Maybe<v8::PropertyAttribute> DebugPropertyIterator::attributes() {
// If you are running into this problem, check your embedder implementation // If you are running into this problem, check your embedder implementation
// and verify that the data from both sides matches. If there is a mismatch, // and verify that the data from both sides matches. If there is a mismatch,
// V8 will crash. // V8 will crash.
DCHECK(result.FromJust() != ABSENT);
#if DEBUG
base::ScopedVector<char> property_message(128);
base::ScopedVector<char> name_buffer(100);
raw_name()->NameShortPrint(name_buffer);
v8::base::SNPrintF(property_message, "Invalid result for property \"%s\"\n",
name_buffer.begin());
DCHECK_WITH_MSG(result.FromJust() != ABSENT, property_message.begin());
#endif
return Just(static_cast<v8::PropertyAttribute>(result.FromJust())); return Just(static_cast<v8::PropertyAttribute>(result.FromJust()));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment