You may be missing the v8_optimized_debug = false build flag. Debug symbols are controlled by the symbol_level flag, which should default to 2 in debug builds, but it might help to manually set that. FWIW, on Linux I get 2640 for nm -a out/x64.debug/libv8_libplatform.so | wc -l.
I recommend using the recommended building workflow <https://v8.dev/docs/build-gn#gm>. In short, tools/dev/gm.py arm64.debug should give you reasonable default settings for debugging (if args.gn doesn't exist yet; if it does exist, it intentionally leaves it alone). On Tue, Jul 9, 2024 at 6:02 PM 'John Davis' via v8-users < v8-users@googlegroups.com> wrote: > Hello > > I'm building v8 on macOS with debugging symbols. (`gn gen ... > is_debug=true`) I see the compile command line to include -g2 > -dwarf-aranges, -D_DEBUG, -DDEBUG. I've compared the `nm` and `nm -a` > output with and without debug switch. > > ``` > $ ls -lh out/arm64.release/d8 > 543K Jul 2 15:37 out/arm64.release/d8* > $ ls -lh out/arm64.debug/d8 > 679K Jul 3 12:32 out/arm64.debug/d8* > $ nm -a out/arm64.release/libv8_libplatform.dylib | wc -l > 938 > $ nm out/arm64.release/libv8_libplatform.dylib | wc -l > 404 > $ nm -a out/arm64.debug/libv8_libplatform.dylib | wc -l > 1130 > $ nm out/arm64.debug/libv8_libplatform.dylib | wc -l > ``` > > It appears debug symbols are present. However, when I try to run the > debugger with the CodeLLDB extension for vscode, I can not hit any > breakpoints. If I build simple C++ apps with a combined compile/link I can > hit breakpoints using this method. > > launch.json: > ``` > { > "version": "0.2.0", > "configurations": [ > { > "name": "clang++ - Debug exe", > "type": "lldb", > "request": "launch", > "program": "${workspaceFolder}/v8/out/arm64.debug/d8", > "args": [ > "${workspaceFolder}/data/foo.js" > ], > "cwd": "${workspaceFolder}/v8/out/arm64.debug", > "stopOnEntry": false, > } > ] > } > ``` > > Any pointers on how to debug v8 code on macOS? > > This electronic communication and the information and any files > transmitted with it, or attached to it, are confidential and are intended > solely for the use of the individual or entity to whom it is addressed and > may contain information that is confidential, legally privileged, protected > by privacy laws, or otherwise restricted from disclosure to anyone else. If > you are not the intended recipient or the person responsible for delivering > the e-mail to the intended recipient, you are hereby notified that any use, > copying, distributing, dissemination, forwarding, printing, or copying of > this e-mail is strictly prohibited. If you received this e-mail in error, > please return the e-mail to the sender, delete it from your computer, and > destroy any printed copy of it. > > -- > > -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/CAKSzg3QcEF8_WJk2Fen5qAZNDmYsu0k8SxHi1SS-cQe33Hr5sg%40mail.gmail.com.