Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lldb_function_to_function_dbi: a hack to avoid crashing on C++ methods #3190

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

yamt
Copy link
Collaborator

@yamt yamt commented Feb 29, 2024

Also, print the function name on argument mismatch.

Also, print the function name on argument mismatch.
// At the DWARF level, we can probably look at DW_AT_object_pointer
// and DW_AT_artificial. I'm not sure how it can be done via the
// LLDB API though.
if (num_function_args + 1 == variable_list.GetSize()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also didn't find a way to get DW_AT_object_pointer from LLDB API.

This workaround seems work, but I have a concern on this condition: would it cause error if this is a vaargs function?
Of course this is not a new problem introduced by this PR, the L358 didn't consider vaargs function either. I'm not sure what will happen for vaargs functions here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my understanding is that, neither num_function_args or variable_list.GetSize() here include the hidden arg for stdarg.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@xujuntwt95329
Copy link
Collaborator

LGTM

@wenyongh wenyongh merged commit 0e8d949 into bytecodealliance:main Mar 4, 2024
406 checks passed
wenyongh added a commit that referenced this pull request Apr 3, 2024
Apply patches which were fixed branch main to branch `release/1.3.x`:
- zephyr: Use zephyr sys_cache instead of CMSIS (#3162)
- Fix llvm jit push funcref/externref result type issue (#3169)
- Fix inconsistent coding convention (#3171)
- VSCode IDE enhancement and readme update (#3172)
- zephyr: include math only with minimal libc (#3177)
- Fix wasm loader handling opcode br_table (#3176)
- Specify language in the wasi socket ext project (#3183)
- lldb_function_to_function_dbi: Fix a null dereference (#3189)
- Fix LLVM assertion failure and update CONTRIBUTING.md (#3197)
- lldb_function_to_function_dbi: A hack to avoid crashing on C++ methods (#3190)
- Fix compilation errors on MinGW (#3217)
- Fix compilation errors on esp-idf platform (#3224)
- Fix aot relocation symbols not found on windows 32-bit (#3231)
- Fix nightly run tsan ASLR issue (#3233)
- Go binding: Change C.long to C.int64_t when call wasm_runtime_set_wasi_args_ex (#3235)
- posix_file.c: Correct the dirfd argument that passes to fstatat (#3244)
- Fix compilation errors on zephyr platform (#3255)
- Fix dynamic offset not updated in op_br for block with ret type (#3269)
- Fix CI error when install packages for macos-14 (#3270)
yamt added a commit to yamt/wasm-micro-runtime that referenced this pull request Apr 4, 2024
…+ methods (bytecodealliance#3190)"

This reverts commit 0e8d949.

Because it doesn't make much sense anymore after we disabled debug info
processing on C++ functions in:
"aot debug: process lldb_function_to_function_dbi only for C".
wenyongh pushed a commit that referenced this pull request Apr 6, 2024
…+ methods (#3190)" (#3281)

This reverts commit 0e8d949.

Because it doesn't make much sense anymore after we disabled debug info
processing on C++ functions in:
"aot debug: process lldb_function_to_function_dbi only for C".
wenyongh added a commit that referenced this pull request Apr 28, 2024
Apply patches which were fixed in branch main to branch `release/1.3.x`:
- aot debug: Fix a few NULL dereferences on errors (#3273)
- aot debug: Fix a NULL dereference (#3274)
- aot debug: Process lldb_function_to_function_dbi only for C (#3278)
- Revert "lldb_function_to_function_dbi: A hack to avoid crashing on C++ methods (#3190)" (#3281)
- Fix warnings/issues reported in Windows and by CodeQL/Coverity (#3275)
- thread mgr: Free aux stack only when it was allocated (#3282)
- interp: Restore context from prev_frame after tail calling a native f
unction (#3283)
- Sync simd opcode definitions spec (#3290)
- Add more checks in wasm loader (#3300)
- Fix posix_fadvise error handling (#3323)
- Fix readdir for posix (#3339)
- wasm loader: Fix checks for opcode ref.func and opcode else (#3340)
- Enhance wasm loader checks for opcode br_table (#3352)
- CI: Use macos-13 instead of macos-latest (#3366)
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 1, 2024
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 1, 2024
…+ methods (bytecodealliance#3190)" (bytecodealliance#3281)

This reverts commit 0e8d949.

Because it doesn't make much sense anymore after we disabled debug info
processing on C++ functions in:
"aot debug: process lldb_function_to_function_dbi only for C".
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 2, 2024
bytecodealliance#3190)

Also, print the function name on argument mismatch.

Signed-off-by: victoryang00 <victoryang00@ucsc.edu>
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 2, 2024
…+ methods (bytecodealliance#3190)" (bytecodealliance#3281)

This reverts commit 0e8d949.

Because it doesn't make much sense anymore after we disabled debug info
processing on C++ functions in:
"aot debug: process lldb_function_to_function_dbi only for C".

Signed-off-by: victoryang00 <victoryang00@ucsc.edu>
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…+ methods (bytecodealliance#3190)" (bytecodealliance#3281)

This reverts commit 0e8d949.

Because it doesn't make much sense anymore after we disabled debug info
processing on C++ functions in:
"aot debug: process lldb_function_to_function_dbi only for C".
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
bytecodealliance#3190)

Also, print the function name on argument mismatch.

Signed-off-by: victoryang00 <victoryang00@ucsc.edu>
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…+ methods (bytecodealliance#3190)" (bytecodealliance#3281)

This reverts commit 0e8d949.

Because it doesn't make much sense anymore after we disabled debug info
processing on C++ functions in:
"aot debug: process lldb_function_to_function_dbi only for C".

Signed-off-by: victoryang00 <victoryang00@ucsc.edu>
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
bytecodealliance#3190)

Also, print the function name on argument mismatch.

Signed-off-by: victoryang00 <victoryang00@ucsc.edu>
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…+ methods (bytecodealliance#3190)" (bytecodealliance#3281)

This reverts commit 0e8d949.

Because it doesn't make much sense anymore after we disabled debug info
processing on C++ functions in:
"aot debug: process lldb_function_to_function_dbi only for C".

Signed-off-by: victoryang00 <victoryang00@ucsc.edu>
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request Jun 7, 2024
bytecodealliance#3190)

Also, print the function name on argument mismatch.

Signed-off-by: victoryang00 <victoryang00@ucsc.edu>
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request Jun 7, 2024
…+ methods (bytecodealliance#3190)" (bytecodealliance#3281)

This reverts commit 0e8d949.

Because it doesn't make much sense anymore after we disabled debug info
processing on C++ functions in:
"aot debug: process lldb_function_to_function_dbi only for C".

Signed-off-by: victoryang00 <victoryang00@ucsc.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants