[vlc-devel] Mac: Cannot get LLDB Symbols for libvlccore.dylib

Sridhar Sarnobat sridhar.sarnobat at gmail.com
Sat Jan 18 06:13:08 CET 2020


Surprisingly that made no difference. Any idea what I'm doing incorrectly?

I added "-g" in 2 places in ../extras/package/macosx/configure.sh (there is
no mention of CXXFLAGS or OBJCFLAGS in this file).

case "${ARCH}" in

x86_64*)

CFLAGS="${CFLAGS} -g -m64 -march=core2 -mtune=core2"

LDFLAGS="${LDFLAGS} -m64"

;;

*x86*)

CFLAGS="${CFLAGS} -g -m32 -march=prescott -mtune=generic"

LDFLAGS="${LDFLAGS} -m32"

;;

esac


But I still get the same "error: use of undeclared identifier 'i_query'".
And the fact that I don't see "CompileUnit" in the below output makes me
wonder if the flag had the intended effect:

(lldb) image lookup -vn  playlist_vaControl
1 match found in /Users/myusername/vlc/build/src/.libs/libvlccore.dylib:
Address: libvlccore.dylib[0x0000000000039130]
(libvlccore.dylib.__TEXT.__text + 222784)
Summary: libvlccore.dylib`playlist_vaControl
Module: file = "/Users/myusername/vlc/build/src/.libs/libvlccore.dylib",
arch = "x86_64"
Symbol: id = {0x000001ef}, range = [0x0000000000039130-0x00000000000396f0),
name="playlist_vaControl"



Here is the only other info about the file that I can think will provide
some clues:

$ ls -lh vlc/build/src/.libs/libvlccore.9.dylib

-rwxr-xr-x 1 sarnobat staff 1.4M Jan 15 21:24
vlc/build/src/.libs/libvlccore.9.dylib

$ strings vlc/build/src/.libs/libvlccore.9.dylib | grep playlist_va

playlist_vaControl

When I used master instead of 3.0.0-git I get some other error when trying
to print, saying the pattern is invalid (I don't recall the exact error).



=========================



Sounds like you built VLC without debug symbols, when you call configure
make
sure to add -g to the C, C++ and Objective-C compiler flags:

../extras/package/macosx/configure.sh […] CFLAGS="-g" CXXFLAGS="-g"
OBJCFLAGS="-g"



On Wed, Jan 15, 2020 at 12:08 PM Sridhar Sarnobat <
sridhar.sarnobat at gmail.com> wrote:

> Thank you for the quick reply. I'll follow up if I need further guidance.
>
> Sridhar Sarnobat
> San Jose, CA 95128 | USA
> Phone: +1 (650) 260-3851 | ss533 at cornell.edu
> SMS me via email: 6073395366 at txt.att.net
> Google Chat: sarnobat.hotmail at gmail.com
> http://www.facebook.com/sridhar.sarnobat
> http://www.linkedin.com/in/sarnobat
> http://github.com/sarnobat
>
>
>
> On Tue, Jan 14, 2020 at 6:38 PM Sridhar Sarnobat <ss401533 at gmail.com>
> wrote:
>
>>
>> *Issue*
>>
>> Cannot get lldb to print local variables for method
>> src/playlist/control.c::playlist_vaControl() .
>>
>>
>> *Reproduction steps*
>>
>> cd vlc
>>
>> git checkout 8d432b0   # tag: 3.0.0-git
>>
>> # follow steps at MacOSCompile wiki page
>>
>>
>> cd build/ \
>>
>> && PATH=/bin/:${PATH} make -j1
>>
>>
>> lldb build/bin/vlc-osx-static
>>
>> (lldb) b playlist_vaControl
>> Breakpoint 1: where = libvlccore.dylib`playlist_vaControl, address =
>> 0x0000000000039130
>>
>> (lldb) run ~/trash/videos/201611070302_51.mp4 vlc://quit
>>
>> Process 82073 stopped
>> * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
>>     frame #0: 0x0000000100109130 libvlccore.dylib`playlist_vaControl
>> libvlccore.dylib`playlist_vaControl:
>> ->  0x100109130 <+0>:  pushq  %rbp
>>     0x100109131 <+1>:  movq   %rsp, %rbp
>>     0x100109134 <+4>:  subq   $0xa0, %rsp
>>     0x10010913b <+11>: movb   %dl, %al
>> Target 0: (vlc-osx-static) stopped.
>>
>> (lldb) p i_query
>> error: use of undeclared identifier 'i_query'
>>
>>
>> *Version info & other info*
>>
>> (-) git tag: 3.0.0-git
>>
>> (-) Source file:
>> https://github.com/videolan/vlc/blob/3.0.0-git/src/playlist/control.c#L52
>>
>> (-) Mac OS X Mojave (10.14.6 (18G2022)) - but also my home laptop whose
>> version I don't have in front of me
>>
>> (-) Library compile info
>>
>>
>> (lldb) image lookup -vn  playlist_vaControl
>>
>> 1 match found in /Users/myusername/vlc/build/src/.libs/libvlccore.dylib:
>>
>>         Address: libvlccore.dylib[0x0000000000039130]
>> (libvlccore.dylib.__TEXT.__text + 222784)
>>
>>         Summary: libvlccore.dylib`playlist_vaControl
>>
>>          Module: file =
>> "/Users/myusername/vlc/build/src/.libs/libvlccore.dylib", arch = "x86_64"
>>
>>          Symbol: id = {0x000001ef}, range =
>> [0x0000000100109130-0x00000001001096f0), name="playlist_vaControl"
>>
>>
>> (-) I have created vlc/build/bin/vlc-osx-static.dSYM but that doesn't
>> seem to be useful
>>
>>
>>
>> *End Goal*
>>
>> Create a simple VLC plugin using C (not Lua) which writes the "now
>> playing" media file out to /tmp/now_playing.txt
>>
>>
>> *Notes*
>>
>> (-) I wish to use lldb for my code comprehension needs. Then I can figure
>> out how to write the code to fulfill my goal
>>
>>
>> (-) I have never contributed to open source before, so please forgive me
>> if I am not following any etiquette.
>>
>> (-) I'm mainly a java developer, but have done a bit of GCC development
>> early in my career. Never CLang, and I'm not familiar with XCode and would
>> prefer command line (but am willing to use XCode if that's the only
>> realistic option). I do have access to Ubuntu but would strongly prefer Mac
>> OS X initially (my Ubuntu machines are headless so would be headless, and
>> slower over ssh)
>>
>>
>> (-) I do not wish to use Lua, mainly because I want to (re)aquaint myself
>> with C programming, but also I vaguely recall a limitation of Lua
>> extensions that native modules do not have (but I could be wrong about).
>>
>>
>> (-) Thank you to all the people who created and maintain this, I've
>> depended on it a lot so far and am pleasantly surprised it all works :)
>> https://wiki.videolan.org/MacOSCompile/
>>
>>
>> Sridhar Sarnobat
>> San Jose, CA 95128 | USA
>> http://www.facebook.com/sridhar.sarnobat
>> http://www.linkedin.com/in/sarnobat
>> http://github.com/sarnobat
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20200117/4ac949d1/attachment.html>


More information about the vlc-devel mailing list