Re: [webkit-dev] dump-class-layout script not working

2018-11-05 Thread Simon Fraser
I assume you've actually done a debug build?

Your command line works for me:

 100$ $ ./Tools/Scripts/dump-class-layout --architecture=x86_64 -c Debug 
JavaScriptCore JSString
  +0 < 24> JSString
  +0 <  8> JSC::JSCell JSC::JSCell
  +0 <  1> JSC::HeapCell JSC::HeapCell
  +0 <  4>   JSC::StructureID m_structureID
  +4 <  1>   JSC::IndexingType m_indexingTypeAndMisc
  +5 <  1>   JSC::JSType m_type
  +6 <  1>   JSC::TypeInfo::InlineTypeFlags m_flags
  +7 <  1>   JSC::CellState m_cellState
  +8 <  4>   unsigned int m_length
 +12 <  2>   uint16_t m_flags
 +14 <  2>   
 +16 <  8> WTF::String m_value
 +16 <  8> WTF::RefPtr > m_impl
 +16 <  8>   WTF::DumbPtrTraits::StorageType m_ptr
Total byte size: 24
Total pad bytes: 2
Padding percentage: 8.33 %

BTW you should never work on class layouts in debug builds, since they may be 
different from shipping.

There are some unit tests for dump-class-layout (they used to be run as part of 
webkitpy tests, but I think Dan changed that?). Do all the tests pass for you?

Simon

> On Nov 5, 2018, at 4:02 PM, Frank Jaeger  wrote:
> 
> Hi Simon, thanks for your help. I am running the script on macOS Mojave 10.14 
> and I'm pretty sure I have the lldb python bindings installed. Or otherwise 
> it should fail when importing them at the beginning of the script, right? 
> From what I understood by reading the script's code, it is directly calling 
> into the lldb binding to dump the class layout, and it's failing inside. 
> 
> As I've said before, the error it gives me implies that the provided 
> framework/class pair has not been found in the image, even though I am sure 
> that the pair is valid and found in the image (e.g. JSC::JSString).
> Da: simon.fra...@apple.com  per conto di Simon Fraser 
> 
> Inviato: lunedì 5 novembre 2018 14:17
> A: Frank Jaeger
> Cc: webkit-dev@lists.webkit.org
> Oggetto: Re: [webkit-dev] dump-class-layout script not working
>  
> Dump-class-layout uses the lldb python bindings. Maybe those are not 
> available on your platform?
> 
> I think we’ve only ever tried it on macOS. What platform are you trying on?
> 
> Simon
> 
>> On Nov 4, 2018, at 12:43 PM, Frank Jaeger > <mailto:fjaege...@outlook.com>> wrote:
>> 
>> Hello. First of all I'm really sorry if this is the wrong mailing list to 
>> post to, webkit-help would have probably been better but it doesn't seem 
>> very active.
>> 
>> I run into some problems while trying to use the dump-class-layout script 
>> (found in Tools/Scripts/). I built WebKit using the build-webkit script with 
>> the --debug flag.
>> 
>> After building, I tried to run the dump-class-layout script with the 
>> following arguments:
>> 
>> ./Tools/Scripts/dump-class-layout --architecture=x86_64 -c Debug 
>> JavaScriptCore JSString
>> 
>> I also tried different frameworks and classes. The script always fails 
>> telling me that "no type matches x in y" where x is the class name I used in 
>> the run and y is the framework name.
>> 
>> Why is this happening? The script is correctly finding the built and 
>> symbolicated framework image, so why is it not working properly? Thanks in 
>> advance.
>> ___
>> webkit-dev mailing list
>> webkit-dev@lists.webkit.org <mailto:webkit-dev@lists.webkit.org>
>> https://lists.webkit.org/mailman/listinfo/webkit-dev 
>> <https://lists.webkit.org/mailman/listinfo/webkit-dev>

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] dump-class-layout script not working

2018-11-05 Thread Joseph Pecoraro


> On Nov 4, 2018, at 3:43 AM, Frank Jaeger  wrote:
> 
> Hello. First of all I'm really sorry if this is the wrong mailing list to 
> post to, webkit-help would have probably been better but it doesn't seem very 
> active.
> 
> I run into some problems while trying to use the dump-class-layout script 
> (found in Tools/Scripts/). I built WebKit using the build-webkit script with 
> the --debug flag.
> 
> After building, I tried to run the dump-class-layout script with the 
> following arguments:
> 
> ./Tools/Scripts/dump-class-layout --architecture=x86_64 -c Debug 
> JavaScriptCore JSString
> 
> I also tried different frameworks and classes. The script always fails 
> telling me that "no type matches x in y" where x is the class name I used in 
> the run and y is the framework name.
> 
> Why is this happening? The script is correctly finding the built and 
> symbolicated framework image, so why is it not working properly? Thanks in 
> advance.

This just worked for me on Mojave.

$ ./Tools/Scripts/dump-class-layout --architecture=x86_64 -c Debug 
JavaScriptCore JSString
  +0 < 24> JSString
  +0 <  8> JSC::JSCell JSC::JSCell
  +0 <  1> JSC::HeapCell JSC::HeapCell
  +0 <  4>   JSC::StructureID m_structureID
  +4 <  1>   JSC::IndexingType m_indexingTypeAndMisc
  +5 <  1>   JSC::JSType m_type
  +6 <  1>   JSC::TypeInfo::InlineTypeFlags m_flags
  +7 <  1>   JSC::CellState m_cellState
  +8 <  4>   unsigned int m_length
 +12 <  2>   uint16_t m_flags
 +14 <  2>   
 +16 <  8> WTF::String m_value
 +16 <  8> WTF::RefPtr > m_impl
 +16 <  8>   WTF::DumbPtrTraits::StorageType m_ptr
Total byte size: 24
Total pad bytes: 2
Padding percentage: 8.33 %

Could you show your exact output?

Perhaps opening a Bugzilla bug and putting the details there would be best. I’d 
be interested to know your version of Xcode/lldb (lldb --version, xcodebuild 
-version).

- Joe

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] dump-class-layout script not working

2018-11-05 Thread Simon Fraser
Dump-class-layout uses the lldb python bindings. Maybe those are not available 
on your platform?

I think we’ve only ever tried it on macOS. What platform are you trying on?

Simon

> On Nov 4, 2018, at 12:43 PM, Frank Jaeger  wrote:
> 
> Hello. First of all I'm really sorry if this is the wrong mailing list to 
> post to, webkit-help would have probably been better but it doesn't seem very 
> active.
> 
> I run into some problems while trying to use the dump-class-layout script 
> (found in Tools/Scripts/). I built WebKit using the build-webkit script with 
> the --debug flag.
> 
> After building, I tried to run the dump-class-layout script with the 
> following arguments:
> 
> ./Tools/Scripts/dump-class-layout --architecture=x86_64 -c Debug 
> JavaScriptCore JSString
> 
> I also tried different frameworks and classes. The script always fails 
> telling me that "no type matches x in y" where x is the class name I used in 
> the run and y is the framework name.
> 
> Why is this happening? The script is correctly finding the built and 
> symbolicated framework image, so why is it not working properly? Thanks in 
> advance.
> ___
> webkit-dev mailing list
> webkit-dev@lists.webkit.org 
> https://lists.webkit.org/mailman/listinfo/webkit-dev 
> 
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


[webkit-dev] dump-class-layout script not working

2018-11-04 Thread Frank Jaeger
Hello. First of all I'm really sorry if this is the wrong mailing list to post 
to, webkit-help would have probably been better but it doesn't seem very active.

I run into some problems while trying to use the dump-class-layout script 
(found in Tools/Scripts/). I built WebKit using the build-webkit script with 
the --debug flag.

After building, I tried to run the dump-class-layout script with the following 
arguments:


./Tools/Scripts/dump-class-layout --architecture=x86_64 -c Debug JavaScriptCore 
JSString

I also tried different frameworks and classes. The script always fails telling 
me that "no type matches x in y" where x is the class name I used in the run 
and y is the framework name.

Why is this happening? The script is correctly finding the built and 
symbolicated framework image, so why is it not working properly? Thanks in 
advance.
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev