[Lldb-commits] [lldb] r344429 - Try to fix some failures on MacOSX with the NativePDB patch.

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 12 16:16:56 PDT 2018


Yep, thanks!

% bin/lldb-test symbols ../f.obj
Module: ../f.obj
Module ../f.obj
0x7fb795587320:   ObjectFileMachO64, file = '../f.obj', triple = x86_64-apple-macosx10.14.0
  SectID     Type             File Address                             Perm File Off.  File Size  Flags      Section Name
  ---------- ---------------- ---------------------------------------  ---- ---------- ---------- ---------- ----------------------------
  0x00000100 container        [0x0000000000000000-0x0000000100000000)  ---  0x00000000 0x00000000 0x00000000 f.obj.__PAGEZERO
  0x00000200 container        [0x0000000100000000-0x0000000100001000)  r-x  0x00000000 0x00001000 0x00000000 f.obj.__TEXT
  0x00000001 code             [0x0000000100000fb0-0x0000000100000fb8)  r-x  0x00000fb0 0x00000008 0x80000400 f.obj.__TEXT.__text
  0x00000002 compact-unwind   [0x0000000100000fb8-0x0000000100001000)  r-x  0x00000fb8 0x00000048 0x00000000 f.obj.__TEXT.__unwind_info
  0x00000300 container        [0x0000000100001000-0x0000000100002000)  r--  0x00001000 0x00000098 0x00000000 f.obj.__LINKEDIT
0x7fb7955871b0: SymbolVendor (../f.obj)


> On Oct 12, 2018, at 3:57 PM, Zachary Turner via lldb-commits <lldb-commits at lists.llvm.org> wrote:
> 
> Author: zturner
> Date: Fri Oct 12 15:57:40 2018
> New Revision: 344429
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=344429&view=rev
> Log:
> Try to fix some failures on MacOSX with the NativePDB patch.
> 
> This adds -- before any filenames, so that /U doesn't get interpreted
> as a command line.
> 
> It also adds better error checking, so that we don't get assertions
> on the failure path when a file fails to parse as a PDB.
> 
> Modified:
>    lldb/trunk/lit/SymbolFile/NativePDB/disassembly.cpp
>    lldb/trunk/lit/SymbolFile/NativePDB/simple-breakpoints.cpp
>    lldb/trunk/lit/SymbolFile/NativePDB/source-list.cpp
>    lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
> 
> Modified: lldb/trunk/lit/SymbolFile/NativePDB/disassembly.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/NativePDB/disassembly.cpp?rev=344429&r1=344428&r2=344429&view=diff
> ==============================================================================
> --- lldb/trunk/lit/SymbolFile/NativePDB/disassembly.cpp (original)
> +++ lldb/trunk/lit/SymbolFile/NativePDB/disassembly.cpp Fri Oct 12 15:57:40 2018
> @@ -1,8 +1,8 @@
> // clang-format off
> 
> // Test that we can show disassembly and source.
> -// RUN: clang-cl /Z7 /GS- /GR- /c %s /Fo%t.obj
> -// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb %t.obj
> +// RUN: clang-cl /Z7 /GS- /GR- /c /Fo%t.obj -- %s
> +// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb -- %t.obj
> // RUN: env LLDB_USE_NATIVE_PDB_READER=1 lldb -f %t.exe -s \
> // RUN:     %p/Inputs/disassembly.lldbinit | FileCheck %s
> 
> 
> Modified: lldb/trunk/lit/SymbolFile/NativePDB/simple-breakpoints.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/NativePDB/simple-breakpoints.cpp?rev=344429&r1=344428&r2=344429&view=diff
> ==============================================================================
> --- lldb/trunk/lit/SymbolFile/NativePDB/simple-breakpoints.cpp (original)
> +++ lldb/trunk/lit/SymbolFile/NativePDB/simple-breakpoints.cpp Fri Oct 12 15:57:40 2018
> @@ -1,8 +1,8 @@
> // clang-format off
> 
> // Test that we can set simple breakpoints using PDB on any platform.
> -// RUN: clang-cl /Z7 /GS- /GR- /c %s /Fo%t.obj
> -// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb %t.obj
> +// RUN: clang-cl /Z7 /GS- /GR- /c /Fo%t.obj -- %s 
> +// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb -- %t.obj
> // RUN: env LLDB_USE_NATIVE_PDB_READER=1 lldb -f %t.exe -s \
> // RUN:     %p/Inputs/breakpoints.lldbinit | FileCheck %s
> 
> 
> Modified: lldb/trunk/lit/SymbolFile/NativePDB/source-list.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/NativePDB/source-list.cpp?rev=344429&r1=344428&r2=344429&view=diff
> ==============================================================================
> --- lldb/trunk/lit/SymbolFile/NativePDB/source-list.cpp (original)
> +++ lldb/trunk/lit/SymbolFile/NativePDB/source-list.cpp Fri Oct 12 15:57:40 2018
> @@ -1,8 +1,8 @@
> // clang-format off
> 
> // Test that we can set display source of functions.
> -// RUN: clang-cl /Z7 /GS- /GR- /c %s /Fo%t.obj
> -// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb %t.obj
> +// RUN: clang-cl /Z7 /GS- /GR- /c /Fo%t.obj -- %s 
> +// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb -- %t.obj
> // RUN: env LLDB_USE_NATIVE_PDB_READER=1 lldb -f %t.exe -s \
> // RUN:     %p/Inputs/source-list.lldbinit | FileCheck %s
> 
> 
> Modified: lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp?rev=344429&r1=344428&r2=344429&view=diff
> ==============================================================================
> --- lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp (original)
> +++ lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp Fri Oct 12 15:57:40 2018
> @@ -70,10 +70,14 @@ static std::unique_ptr<PDBFile> loadPDBF
>       std::move(Buffer), llvm::support::little);
> 
>   auto File = llvm::make_unique<PDBFile>(Path, std::move(Stream), Allocator);
> -  if (auto EC = File->parseFileHeaders())
> +  if (auto EC = File->parseFileHeaders()) {
> +    llvm::consumeError(std::move(EC));
>     return nullptr;
> -  if (auto EC = File->parseStreamData())
> +  }
> +  if (auto EC = File->parseStreamData()) {
> +    llvm::consumeError(std::move(EC));
>     return nullptr;
> +  }
> 
>   return File;
> }
> @@ -109,6 +113,9 @@ loadMatchingPDBFile(std::string exe_path
>   if (ec || magic != llvm::file_magic::pdb)
>     return nullptr;
>   std::unique_ptr<PDBFile> pdb = loadPDBFile(pdb_file, allocator);
> +  if (!pdb)
> +    return nullptr;
> +
>   auto expected_info = pdb->getPDBInfoStream();
>   if (!expected_info) {
>     llvm::consumeError(expected_info.takeError());
> 
> 
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits



More information about the lldb-commits mailing list