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

When I'm trying to debug the C code of FFmpeg, I can perform breakpoint debugging, but I'm unable to obtain the list and values of symbolic variables. #120

Open
vaptu opened this issue Jul 31, 2024 · 4 comments

Comments

@vaptu
Copy link

vaptu commented Jul 31, 2024

platform: macos 14.0
compiler: Apple clang version 15.0.0 (clang-1500.0.40.1)
ffmpeg: 4.4.1 (--enable-debug)

My breakpoints in the Rust code are correct, but once it enters the C code block, although the breakpoint behavior is still fine, it cannot display all the variable lists and variable values in the C code.

I saw this log in the LLVM output: 'warning: test-f3214074073240dc was compiled with optimization - stepping may behave oddly; variables may not be available.'

However, I don't know how to resolve it and seek your help.

@ldm0
Copy link
Collaborator

ldm0 commented Jul 31, 2024

The debuginfo of your FFmpeg libs might have been stripped.

It's highly recommended to build FFmpeg yourself. You can follow the official compilation guide or use the utils/mac_ffmpeg.rs provided in rsmpeg as a shortcut.

After FFmpeg building, set FFMPEG_PKG_CONFIG_PATH to the pkgconfig directory, then recompile your project, and everything should be fine.

@vaptu
Copy link
Author

vaptu commented Jul 31, 2024

Thank you very much. I'm using a self-compiled version of FFmpeg(4.4.1), and when I tried to debug using C++, I didn't find that the aforementioned situation could be normally supported for debugging.

Below are my build options. Can you see any anomalies?

./configure --enable-static --enable-gpl --enable-libx264 --enable-nonfree --disable-coreimage \
--enable-libopus --enable-libfreetype --enable-libass --disable-doc --disable-avdevice --enable-debug \
--enable-openssl --enable-libfreetype --enable-libmp3lame --enable-libx265 --enable-libsrt --enable-decoder=png \
--enable-zlib --enable-pthreads --disable-autodetect --enable-libfontconfig --prefix=/opt/local/ --enable-sdl2 \
--enable-ffplay --enable-videotoolbox

@ldm0
Copy link
Collaborator

ldm0 commented Jul 31, 2024

Below are my build options. Can you see any anomalies?

Nope, it's legit.

Did you compile your Rust project in release mode? rust-lang/cargo#13257

@vaptu
Copy link
Author

vaptu commented Jul 31, 2024

I've double-checked, and I can confirm that I am indeed using debug mode.

This situation is quite strange. It can correctly jump to the line information in the C source code, but it seems unable to obtain variable information through LLVM.

Thank you for your patient reply. I think I can try to see if I encounter this problem in a Linux environment to rule out LLVM-related issues.

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

No branches or pull requests

2 participants