[tools] Fix lldb_commands jco by casting call

Currently, running jco gives us an error message like so:

(lldb) jco $pc
Failed to evaluate command _v8_internal_Print_Code((void*)($pc)) :
error: <user expression 0>:1:1: '_v8_internal_Print_Code' has unknown
return type; cast the call to its declared return type
_v8_internal_Print_Code((void*)($pc))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The fix is to cast the call to (void). I've only used and found this
issue with jco, but I think the other commands have the same issue, so
fixing those together here.

FYI I am using lldb version 11.

Bug: v8:11879
Change-Id: Id9d8e8091fd011585e6fea863de5b4d7c9d47c5a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2994764
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75487}
This commit is contained in:
Ng Zhi An 2021-06-30 09:31:10 -07:00 committed by V8 LUCI CQ
parent 0585ada4c0
commit c83501448b

View File

@ -21,7 +21,8 @@ def current_frame(debugger):
return current_thread(debugger).GetSelectedFrame() return current_thread(debugger).GetSelectedFrame()
def no_arg_cmd(debugger, cmd): def no_arg_cmd(debugger, cmd):
evaluate_result = current_frame(debugger).EvaluateExpression(cmd) cast_to_void_expr = '(void) {}'.format(cmd)
evaluate_result = current_frame(debugger).EvaluateExpression(cast_to_void_expr)
# When a void function is called the return value type is 0x1001 which # When a void function is called the return value type is 0x1001 which
# is specified in http://tiny.cc/bigskz. This does not indicate # is specified in http://tiny.cc/bigskz. This does not indicate
# an error so we check for that value below. # an error so we check for that value below.