I'm now submitting a CL
<https://chromium-review.googlesource.com/c/v8/v8/+/3945108> that adds some
quick gdb helpers:

  (gdb) source v8/tools/gdbinit
  # Print Member:
  (gdb) cpm *<member-name>*
  # Print Compressed Pointer:
  (gdb) cpcp *<compressed-32-bit-value>*

It currently erases the pointee type, but this can be improved in the
future.

On Tue, Oct 11, 2022 at 4:05 PM Anton Bikineev <[email protected]>
wrote:

> Which should hopefully be callable from the debugger and not eliminated by
>> the linker?
>
> We can apply __attribute__((used,retain)) to make sure that the linker
> doesn't strip the functions with --gc-sections, same as did
> <https://chromium-review.googlesource.com/c/v8/v8/+/3932179> for V8
> helpers (a week ago :) ). I'll prepare a CL.
>
> On Mon, Oct 10, 2022 at 8:45 PM Daniel Cheng <[email protected]> wrote:
>
>> For now, I guess it should be sufficient to add something
>> to v8/include/cppgc/internal/member-storage.h like
>>
>> #ifndef NDEBUG  // DCHECK_IS_ON() would be nicer, but not sure what v8
>> uses
>> extern "C" void* DecompressPointerForDebugger(uint32_t value) {
>>   return cppgc::internal::CompressedPointer::Decompress(value);
>> }
>> #endif
>>
>> Which should hopefully be callable from the debugger and not eliminated
>> by the linker?
>>
>> Daniel
>>
>> On Mon, 10 Oct 2022 at 11:32, Stefan Zager <[email protected]> wrote:
>>
>>> I ran into this today, and it's pretty frustrating:
>>>
>>> (rr) p inner_node_
>>>
>>> $11 = {
>>>
>>>   <cppgc::internal::MemberBase> = {
>>>
>>>     raw_ = {
>>>
>>>       static kCompressedSentinel = 1,
>>>
>>>       value_ = 2148082696 <(214)%20808-2696>
>>>
>>>     }
>>>
>>>   },
>>>
>>>   <cppgc::internal::DisabledCheckingPolicy> = {<No data fields>}, <No
>>> data fields>}
>>> (rr) p inner_node_.Load()
>>>
>>> Couldn't find method blink::Member<blink::Node>::Load
>>>
>>> (rr) p inner_node_.raw_.Load()
>>>
>>> Cannot evaluate function -- may be inlined
>>>
>>> (rr) p
>>> cppgc::internal::CompressedPointer::Decompress(inner_node_.raw_.value_)
>>>
>>> Cannot evaluate function -- may be inlined
>>>
>>> (rr)
>>>
>>> I found that I can avoid the issue with this in args.gn:
>>>
>>> cppgc_enable_caged_heap = false
>>> cppgc_enable_pointer_compression = false
>>>
>>> ... but I would prefer a better solution.
>>>
>>> On Mon, Oct 10, 2022 at 10:22 AM Ian Kilpatrick <
>>> [email protected]> wrote:
>>>
>>>> Is there a bug to follow regarding the debuggability of the pointers?
>>>>
>>>> Ian
>>>>
>>>> On Thu, Sep 22, 2022 at 11:10 AM Anton Bikineev <[email protected]>
>>>> wrote:
>>>>
>>>>> There is "cppgc::internal::CompressedPointer::Decompress(void*)". I
>>>>> would, however, hide it behind a simpler name in .gdbinit.
>>>>>
>>>>> On Thu, Sep 22, 2022 at 5:51 PM Daniel Cheng <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Is there a callable C++ function that can turn a compressed pointer
>>>>>> into the actual pointer value?
>>>>>>
>>>>>> Daniel
>>>>>>
>>>>>> On Thu, 22 Sept 2022 at 08:43, Anton Bikineev <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> We have plans to provide more debugging tooling for Oilpan. I
>>>>>>> haven't had a need to examine compressed pointers myself, however I see
>>>>>>> that some simple gdb/windbg function that'd follow pointers would be 
>>>>>>> useful.
>>>>>>>
>>>>>>> On Thu, Sep 22, 2022 at 1:14 AM Kentaro Hara <[email protected]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> +Michael Lippautz <[email protected]>
>>>>>>>>
>>>>>>>> 2022年9月22日(木) 4:01 'Daniel Libby' via blink-dev <
>>>>>>>> [email protected]>:
>>>>>>>>
>>>>>>>>> https://crrev.com/c/3835682 enabled pointer compression for Blink
>>>>>>>>> Member<> pointers. How are folks handling these while debugging 
>>>>>>>>> (either
>>>>>>>>> live or crash dumps)? Is there some tooling available that will look 
>>>>>>>>> up and
>>>>>>>>> apply the cage base?
>>>>>>>>>
>>>>>>>>> I didn't see anything mentioned in
>>>>>>>>> https://docs.google.com/document/d/1neGN8Jq-1JLrWK3cvwRIfrSjLgE0Srjv-uq7Ze38Iao/edit#
>>>>>>>>> but maybe there are better known tools/techniques from v8 (which IIUC 
>>>>>>>>> has
>>>>>>>>> had compressed pointers for some time now).
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>>> Groups "blink-dev" group.
>>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>>> send an email to [email protected].
>>>>>>>>> To view this discussion on the web visit
>>>>>>>>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/4b3e5bbb-134a-4483-9a1e-8e33fbc6f38en%40chromium.org
>>>>>>>>> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/4b3e5bbb-134a-4483-9a1e-8e33fbc6f38en%40chromium.org?utm_medium=email&utm_source=footer>
>>>>>>>>> .
>>>>>>>>>
>>>>>>>> --
>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>> Groups "blink-dev" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>> send an email to [email protected].
>>>>>>>> To view this discussion on the web visit
>>>>>>>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABg10jxSdx3JzWvTC2j7RUEcw01P9gTRhT%3DnftwehY3br4qNWA%40mail.gmail.com
>>>>>>>> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABg10jxSdx3JzWvTC2j7RUEcw01P9gTRhT%3DnftwehY3br4qNWA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "blink-dev" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to [email protected].
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABH6udYH6VGy8Ooz6ZLZWpWR_LjjQfu1xh-AMBvWoyAnArojbA%40mail.gmail.com
>>>>>>> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABH6udYH6VGy8Ooz6ZLZWpWR_LjjQfu1xh-AMBvWoyAnArojbA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "blink-dev" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABH6udZS_4iw6Vhb%3Dtf0J9qgV%3DbwbcWAu%2B--Xt9dYrDpqDecXw%40mail.gmail.com
>>>>> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABH6udZS_4iw6Vhb%3Dtf0J9qgV%3DbwbcWAu%2B--Xt9dYrDpqDecXw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "blink-dev" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJL3UpQ%2BiPOAMX6ONDxRm9UG0zFRkScw1%3DdALFGdKJOUiAUpEw%40mail.gmail.com
>>>> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJL3UpQ%2BiPOAMX6ONDxRm9UG0zFRkScw1%3DdALFGdKJOUiAUpEw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABH6udZ7rMMqmsZ98RbS21yG_DBXXtnoOVYnO4oV%3Dno3tFvNug%40mail.gmail.com.

Reply via email to