• Seth Brenith's avatar
    Fix brittleness of GetObjectProperties test · 51d2e988
    Seth Brenith authored
    Part of the GetObjectProperties test case is for verifying the human-
    readable brief object description string that GetObjectProperties
    returns. That string might look something like this:
    
    "xy" (0x28f038d5 <v8::internal::SeqOneByteString>)
    
    GetObjectProperties also tries to detect known immortal objects by
    recognizing their addresses, which is useful in crash dumps with limited
    memory. The recognized object name, if it exists, is prepended to the
    description string. In order to provide this data accurately (in builds
    without pointer compression), GetObjectProperties relies on the caller
    to provide the addresses of the first pages in read-only space, map
    space, and old space. If the caller doesn't provide those addresses,
    then GetObjectProperties does the best it can with limited information
    and reports possible matches based on an object's offset within the heap
    page that contains it. So the result string might look like this, if the
    object happened to get allocated at a lucky offset within its page:
    
    maybe LoadHandler3Map "xy" (0x28f038d5 <v8::internal::SeqOneByteString>)
    
    As a result, when testing these descriptions, we should generally check
    that they contain the interesting data rather than that they start with
    it, because some incorrect "maybe" match with a known object might be
    included at the beginning.
    
    Bug: v8:10034
    Change-Id: I0cf5afd67793a239614aba3665ef57cd2d663a47
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1950233Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
    Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
    Cr-Commit-Position: refs/heads/master@{#65432}
    51d2e988
test-debug-helper.cc 15.7 KB