jerryscript icon indicating copy to clipboard operation
jerryscript copied to clipboard

Some questions when debugging JS Script?

Open Yu3H0 opened this issue 3 years ago • 1 comments

Hi:

  1. I would like to know if there is any method to print out the details of objects during debugging my JS script in jerry, just like% DebugPrint in d8:
DebugPrint: 0x2aed08109a75: [JSArray]
 - map: 0x2aed082c3a41 <Map(PACKED_SMI_ELEMENTS)> [FastProperties]
 - prototype: 0x2aed0828c0e9 <JSArray[0]>
 - elements: 0x2aed082932dd <FixedArray[3]> [PACKED_SMI_ELEMENTS (COW)]
 - length: 3
 - properties: 0x2aed0800222d <FixedArray[0]>
 - All own properties (excluding elements): {
    0x2aed080048f1: [String] in ReadOnlySpace: #length: 0x2aed0820215d <AccessorInfo> (const accessor descriptor), location: descriptor
 }
 - elements: 0x2aed082932dd <FixedArray[3]> {
           0: 1
           1: 2
           2: 3
 }
  1. Is there any support for GDB, or can I only write my own debugger like the sample program in jerry-debugger folder

  2. Can the breakpoint be set in the JS file, like %SystemBreak in d8 instead of setting a breakpoint in the debugger

Thank you very much!

Yu3H0 avatar Nov 13 '21 05:11 Yu3H0

Hi!

1 - 2, These features are not available and currently we are not planning to do it. However any contributions are welcome. 3, You can use the debugger statement in the JS code which automatically inserts a breakpoint for the debugger.

rerobika avatar Dec 08 '21 10:12 rerobika