This patch adds previews of JS function arguments in backtrace
annotations. For example:
(gdb) bt
#6 ... [test_func_3 @ throw.js:15:21]
(this=0x..., [0]=<Smi: 44>, [1]=0x... <Oddball: TrueValue>, ...)
This also adds a `v8 args` command to show the full argument list for a
frame.
(gdb) v8 args 6
#6 test_func_3 @ .../throw.js:15:21
this = 0x... <JSGlobalProxy>
[0]= <Smi: 44>
[1]= 0x... <Oddball: TrueValue>
...
In addition, `v8 inspect` now accepts "this" and "[N]" as argument for
inspecting the receiver and arguments of the selected frame. For
example:
(gdb) v8 inspect this
0x... <JSGlobalProxy>
.map=0x... <Map>
.properties_or_hash=<Smi: 11106>
...
(gdb) v8 inspect [1]
0x... <Oddball: TrueValue>
.map=0x... <Map: BooleanMap>
...
The debug helper now derives argument offsets from
StandardFrameConstants instead of hardcoding frame-pointer offsets, and
report them as "receiver" and "arguments" properties in the array, the
latter has a size of the argc slot (minus the receiver). The C ABI is
unchanged.
Change-Id: I8fcac49835cbf412d8959fdb325dc85a0e89ad58
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8293838
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Reviewed-by: Paolo Severini <paolosev@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#110161}