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

Standalone debug file search path does not match GDB #18277

Closed
emaste opened this issue Nov 13, 2013 · 4 comments
Closed

Standalone debug file search path does not match GDB #18277

emaste opened this issue Nov 13, 2013 · 4 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla lldb

Comments

@emaste
Copy link
Member

emaste commented Nov 13, 2013

Bugzilla Link 17903
Resolution FIXED
Resolved on Nov 25, 2013 14:34
Version unspecified
OS FreeBSD

Extended Description

See e.g. https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html

For an example file /usr/bin/ls with a debuglink file of ls.debug, the search paths should be, in order:

/usr/lib/debug/.build-id/ab/cdef1234.debug
/usr/bin/ls.debug
/usr/bin/.debug/ls.debug
/usr/lib/debug/usr/bin/ls.debug

On FreeBSD, we use by default the 4th case from the GDB example above - /bin/ls has debug info in /usr/lib/debug/bin/ls.debug.

Adding some debug logging to Symbols::LocateExecutableSymbolFile shows the following paths being tried:
Directory /bin
Trying file /bin/ls.debug
Trying file /bin/.debug/ls.debug
Trying file /bin/.build-id/F4/DD1447000000000000000000000000.debug
Trying file /bin/bin/ls
Directory /data/emaste/src/llvm/build
Trying file /data/emaste/src/llvm/build/ls.debug
Trying file /data/emaste/src/llvm/build/.debug/ls.debug
Trying file /data/emaste/src/llvm/build/.build-id/F4/DD1447000000000000000000000000.debug
Trying file /data/emaste/src/llvm/build/bin/ls
Directory /usr/lib/debug
Trying file /usr/lib/debug/ls.debug
Trying file /usr/lib/debug/.debug/ls.debug
Trying file /usr/lib/debug/.build-id/F4/DD1447000000000000000000000000.debug
Trying file /usr/lib/debug/bin/ls

The current set of LLDB search paths is, for each of dirname in <module_dir>, , and /usr/lib/debug:

    files.push_back (dirname + "/" + symbol_filename);                      
    files.push_back (dirname + "/.debug/" + symbol_filename);               
    files.push_back (dirname + "/.build-id/" + uuid_str);                   
    files.push_back (dirname + module_filename);                            

This ends up including extra paths not in GDB (e.g. /usr/bin/.build-id/<uuid_str>), and excluding paths that are (e.g. /usr/lib/debug/usr/bin/ls.debug). The paths are also in a different order, compared to GDB.

@emaste
Copy link
Member Author

emaste commented Nov 13, 2013

assigned to @emaste

@emaste
Copy link
Member Author

emaste commented Nov 13, 2013

@emaste
Copy link
Member Author

emaste commented Nov 15, 2013

Committed to FreeBSD as http://svnweb.freebsd.org/base?view=revision&revision=258094

@emaste
Copy link
Member Author

emaste commented Nov 25, 2013

Committed as r195681

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla lldb
Projects
None yet
Development

No branches or pull requests

1 participant