Page MenuHomePhabricator

Teach the default symbol vendor to respect module.GetSymbolFileFileSpec()
ClosedPublic

Authored by labath on Fri, Jan 11, 4:23 AM.

Details

Summary

Adding a breakpad symbol file to an existing MachO module with "target symbols
add" currently works only if one's host platform is a mac. This is
because SymbolVendorMacOSX (which is the one responsible for loading
symbols for MachO files) is conditionally compiled for the mac platform.

While we will sooner or later have a special symbol vendor for breakpad
files (to enable more advanced searching), and so this flow could be
made to work through that, it's not clear to me whether this should be a
requirement for the "target symbols add" flow to work. After all, since
the user has explicitly specified the symbol file to use, the symbol
vendor plugin's job is pretty much done.

This patch teaches the default symbol vendor to respect module's symbol
file spec, and load the symbol from that file if it is specified (and no
plugin requests any special handling).

Diff Detail

Repository
rLLDB LLDB

Event Timeline

labath created this revision.Fri, Jan 11, 4:23 AM
clayborg accepted this revision.Tue, Jan 15, 8:24 AM
This revision is now accepted and ready to land.Tue, Jan 15, 8:24 AM
lemo accepted this revision.Tue, Jan 15, 11:47 AM
This revision was automatically updated to reflect the committed changes.

Looks like this test is failing on green dragon:

http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/17221/consoleFull#-97272088254eaf0-7326-4999-85b0-388101f2d404

FAIL: LLDB :: SymbolFile/Breakpad/symtab-macho.test (126 of 1452)
******************** TEST 'LLDB :: SymbolFile/Breakpad/symtab-macho.test' FAILED ********************
Script:
--
: 'RUN: at line 1';   /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/yaml2obj /Users/buildslave/jenkins/workspace/lldb-cmake/llvm/tools/lldb/lit/SymbolFile/Breakpad/Inputs/basic-macho.yaml > /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/lit/SymbolFile/Breakpad/Output/symtab-macho.out
: 'RUN: at line 2';   /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/lldb -S /Users/buildslave/jenkins/workspace/lldb-cmake/llvm/tools/lldb/lit/lit-lldb-init /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/lit/SymbolFile/Breakpad/Output/symtab-macho.out -o "target symbols add -s symtab-macho.out /Users/buildslave/jenkins/workspace/lldb-cmake/llvm/tools/lldb/lit/SymbolFile/Breakpad/Inputs/symtab-macho.syms"    -s /Users/buildslave/jenkins/workspace/lldb-cmake/llvm/tools/lldb/lit/SymbolFile/Breakpad/symtab-macho.test | /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/FileCheck /Users/buildslave/jenkins/workspace/lldb-cmake/llvm/tools/lldb/lit/SymbolFile/Breakpad/symtab-macho.test
--
Exit Code: 1

Command Output (stderr):
--
warning: UUID mismatch detected between modules:
     /Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/tools/lldb/lit/SymbolFile/Breakpad/Output/symtab-macho.out
    B3051760-22B1-7D7B-39F9-240E077D625B /Users/buildslave/jenkins/workspace/lldb-cmake/llvm/tools/lldb/lit/SymbolFile/Breakpad/Inputs/symtab-macho.syms
error: symbol file '/Users/buildslave/jenkins/workspace/lldb-cmake/llvm/tools/lldb/lit/SymbolFile/Breakpad/Inputs/symtab-macho.syms' does not match any existing module
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm/tools/lldb/lit/SymbolFile/Breakpad/symtab-macho.test:6:16: error: CHECK-LABEL: expected string not found in input
# CHECK-LABEL: (lldb) image dump symtab symtab-macho.out
               ^
<stdin>:1:1: note: scanning from here
(lldb) command source -s 0 '/Users/buildslave/jenkins/workspace/lldb-cmake/llvm/tools/lldb/lit/lit-lldb-init'
^
<stdin>:8:1: note: possible intended match here
(lldb) target symbols add -s symtab-macho.out /Users/buildslave/jenkins/workspace/lldb-cmake/llvm/tools/lldb/lit/SymbolFile/Breakpad/Inputs/symtab-macho.syms
^

--