Page MenuHomePhabricator
Feed Advanced Search

Yesterday

labath accepted D66174: [Utility] Reimplement RegularExpression on top of llvm::Regex.

lgtm. Thanks for doing this.

Fri, Aug 16, 11:41 AM · Restricted Project, Restricted Project
labath added a comment to D66345: [lldb][NFC] Allow for-range iterating over StringList.

Not sure if we can get rid of StringList so easily as we still have SBStringList.

Fri, Aug 16, 7:53 AM · Restricted Project
labath accepted D66345: [lldb][NFC] Allow for-range iterating over StringList.

Definitely an improvement, though one day, i'd like to get rid of the StringList class (and various other XXXList classes) completely :)

Fri, Aug 16, 7:01 AM · Restricted Project
labath updated the diff for D66344: Filesystem/Windows: fix inconsistency in readNativeFileSlice API.
  • change the test memset to a different value to properly test the zeroing aspect of the API
Fri, Aug 16, 6:20 AM · Restricted Project
labath added inline comments to D63453: [Support] Move llvm::MemoryBuffer to sys::fs::file_t.
Fri, Aug 16, 6:19 AM · Restricted Project
labath created D66344: Filesystem/Windows: fix inconsistency in readNativeFileSlice API.
Fri, Aug 16, 6:09 AM · Restricted Project
labath added a comment to D66250: [JIT][Unwinder] Add Trampoline ObjectFile and UnwindPlan support for FCB.

I have one high-level question. Who is generating the code inside the "trampoline" object file? Couldn't we have him generate proper unwind information so that the regular unwind machinery "just works"? I imagine all it would take is a couple of well-placed .cfi assembler directives...

The ABI plugin creates the trampoline by writing bytes directly IIRC. The trampoline has to save the entire register context to the stack before it calls the jitted function that does the comparison and possibly breaks. Then the trampoline restores all the register context, executes any replaced functions, and then jumps directly back into the original function.

The trampoline has to be expressed in terms of assembly (or hardcoded bytes) because we're not using the normal calling conventions - we have to spill all registers so the jitted function doesn't overwrite a caller-spilled register and corrupt the original user function that we're patching in to. Also, it is not CALLed from the original user function, it is JMPed to, so there's no way for the unwinder to get from the trampoline function back to the original user function by looking at the stack.

The question is then, why do we have to JMP to the trampoline? This simplifies running the replaced instructions in the trampoline, because the stack pointer and frame pointer have the original user function's values when the replaced instructions are executed at the end of the trampoline. Using a CALL to get from the original function to the trampoline solves the unwinder problem, but we're still going to need to express the trampoline in assembly terms to save & restore all the registers, and have the replaced instructions execute.

On non-x86 architectures, like Aarch64, doing a function call to the trampoline would mean we need to spill the $lr value to the stack in the original user function before calling the trampoline so we don't overwrite the value; that's a larger number of instructions that need to be shifted into the trampoline to execute.

Of course the only reason we have this ObjectFile plugin is for the unwinder's benefit. If we used a CALL instruction to get to the trampoline, and we sent the assembly through the clang FE as a series of asm()s to jit it, instead of writing the bytes down, the unwinder would get the unwind information as we do a normal jitted function -- you're right, cfi directives to point to the saved register context would be sufficient.

But because we're jumping directly to the trampoline, and jumping back from the trampoline, we need to have a hand-written unwind plan that has the return address hard coded in it for the unwinder to work.

Is having a small ObjectFile plugin for this purpose a bad idea? It seems like the right approach, but maybe I'm not seeing the issue. The CreateInstance method returns false always, so when we iterate looking for an ObjectFile plugin, we will call this method but it will return false right away.

Fri, Aug 16, 2:47 AM · Restricted Project
labath added a comment to D66331: Save / restore selected platform in tests that may change it.

I'm not sure if fixing this on a test-by-test basis is the right place for it. It might be better to have dotest.py's run_suite() save the remote platform and lldbtest.py's class Base setUpClass() method re-set the platform before the test is invoked, in case it was mutated during a test run.

Fri, Aug 16, 1:23 AM · Restricted Project

Thu, Aug 15

labath committed rG11d9e46f8e04: Revert "MemoryBuffer: Add a missing error-check to getOpenFileImpl" (authored by labath).
Revert "MemoryBuffer: Add a missing error-check to getOpenFileImpl"
Thu, Aug 15, 10:53 AM
labath committed rL369027: Revert "MemoryBuffer: Add a missing error-check to getOpenFileImpl".
Revert "MemoryBuffer: Add a missing error-check to getOpenFileImpl"
Thu, Aug 15, 10:52 AM
labath added a comment to D66224: MemoryBuffer: Add a missing error-check to getOpenFileImpl.

Ok, I have an idea what's going on. There's a difference in the behavior of readNativeFileSlice on windows&posix, and neither of them really do what MemoryBuffer expects here. I don't have time to fix this today so I'll revert and get back to this tomorrow. Thanks for the heads up.

Thu, Aug 15, 10:49 AM · Restricted Project
labath added a comment to D66224: MemoryBuffer: Add a missing error-check to getOpenFileImpl.

It looks like this changed caused 30 or so of the tests to fail on the Windows bot. It was already broken, so you wouldn't have gotten an email:

http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/7851

Thu, Aug 15, 10:17 AM · Restricted Project
labath added a comment to D66249: [JIT][Breakpoint] Add "BreakpointInjectedSite" and FCB Trampoline.

I didn't go into all the details of this patch, as I am guessing this will still go through a number of revisions, but I did make a couple notes of things that caught my eye while glancing over it.

Thu, Aug 15, 4:22 AM · Restricted Project
labath added a comment to D66250: [JIT][Unwinder] Add Trampoline ObjectFile and UnwindPlan support for FCB.

I have one high-level question. Who is generating the code inside the "trampoline" object file? Couldn't we have him generate proper unwind information so that the regular unwind machinery "just works"? I imagine all it would take is a couple of well-placed .cfi assembler directives...

Thu, Aug 15, 3:54 AM · Restricted Project
labath added a comment to D66174: [Utility] Reimplement RegularExpression on top of llvm::Regex.

I was unhappy with the () workaround, so I did some investigation. Now, I am even more unhappy, but at least better educated. :P

Thu, Aug 15, 2:40 AM · Restricted Project, Restricted Project
labath committed rG46bfdb956cb8: MemoryBuffer: Add a missing error-check to getOpenFileImpl (authored by labath).
MemoryBuffer: Add a missing error-check to getOpenFileImpl
Thu, Aug 15, 1:22 AM
labath committed rL368977: MemoryBuffer: Add a missing error-check to getOpenFileImpl.
MemoryBuffer: Add a missing error-check to getOpenFileImpl
Thu, Aug 15, 1:19 AM
labath closed D66224: MemoryBuffer: Add a missing error-check to getOpenFileImpl.
Thu, Aug 15, 1:19 AM · Restricted Project

Wed, Aug 14

labath added a comment to D66224: MemoryBuffer: Add a missing error-check to getOpenFileImpl.

PS: I discovered this when accidentally trying to read a directory, but it is not possible to write a portable test for that, as some BSDs will actually allow you to do that, so the test is written via a write-only file handle instead.

Wed, Aug 14, 8:40 AM · Restricted Project
labath created D66224: MemoryBuffer: Add a missing error-check to getOpenFileImpl.
Wed, Aug 14, 8:40 AM · Restricted Project
labath added a comment to D65643: raw_ostream: add operator<< overload for std::error_code.

Unfortunately, I've hit a snag with this implementation. It turns out changing bool(EC) to EC != std::error_code() is not NFC because one can have two "success" values that still compare as unequal (e.g. std::error_code(0, generic_category()) and std::error_code(0, system_category()). This is a problem because std::error_code() is std::error_code(0, system_category()) and there some (though few) places in llvm that do return std::error_code(errno, generic_category()), and at least some of those places are not bugs (though I think some are).

Wed, Aug 14, 7:34 AM · Restricted Project
labath committed rG0d802a4923e6: Revert "raw_ostream: add operator<< overload for std::error_code" (authored by labath).
Revert "raw_ostream: add operator<< overload for std::error_code"
Wed, Aug 14, 7:01 AM
labath committed rL368854: Revert "raw_ostream: add operator<< overload for std::error_code".
Revert "raw_ostream: add operator<< overload for std::error_code"
Wed, Aug 14, 7:01 AM
labath committed rG40837e97b199: raw_ostream: add operator<< overload for std::error_code (authored by labath).
raw_ostream: add operator<< overload for std::error_code
Wed, Aug 14, 6:33 AM
labath committed rL368849: raw_ostream: add operator<< overload for std::error_code.
raw_ostream: add operator<< overload for std::error_code
Wed, Aug 14, 6:32 AM
labath closed D65643: raw_ostream: add operator<< overload for std::error_code.
Wed, Aug 14, 6:32 AM · Restricted Project
labath updated the summary of D65643: raw_ostream: add operator<< overload for std::error_code.
Wed, Aug 14, 6:31 AM · Restricted Project
labath added a comment to D65643: raw_ostream: add operator<< overload for std::error_code.

Thanks! I actually like the ASSERT_NO_ERROR macros, std::error_code() meaning success is pretty obscure to write everywhere.

Wed, Aug 14, 6:29 AM · Restricted Project
labath committed rGb8ee0dd72369: Revert "Minidump/Windows: Fix module lookup" (authored by labath).
Revert "Minidump/Windows: Fix module lookup"
Wed, Aug 14, 5:30 AM
labath committed rL368838: Revert "Minidump/Windows: Fix module lookup".
Revert "Minidump/Windows: Fix module lookup"
Wed, Aug 14, 5:25 AM
labath committed rG72ef113d40ef: [API] Have SBCommandReturnObject::GetOutput/Error return "" instead of nullptr (authored by labath).
[API] Have SBCommandReturnObject::GetOutput/Error return "" instead of nullptr
Wed, Aug 14, 1:13 AM
labath committed rL368806: [API] Have SBCommandReturnObject::GetOutput/Error return "" instead of nullptr.
[API] Have SBCommandReturnObject::GetOutput/Error return "" instead of nullptr
Wed, Aug 14, 1:13 AM
labath closed D65739: [API] Have SBCommandReturnObject::GetOutput/Error return "" instead of nullptr.
Wed, Aug 14, 1:13 AM · Restricted Project
labath added a comment to D62570: Use LLVM's debug line parser in LLDB.

Thank you for working on this.

Wed, Aug 14, 12:53 AM · Restricted Project, Restricted Project
labath added inline comments to D66148: [SemanticTypedef] Provide a semantic typedef class and operators.
Wed, Aug 14, 12:50 AM · Restricted Project
labath added a comment to D66174: [Utility] Reimplement RegularExpression on top of llvm::Regex.

Overall, I am very supportive of this, though I have some comments inline. The interface seems ok, though maybe you could add a couple of quick unit tests to show how the class is meant to be used.

Wed, Aug 14, 12:38 AM · Restricted Project, Restricted Project

Tue, Aug 13

labath added a comment to D65739: [API] Have SBCommandReturnObject::GetOutput/Error return "" instead of nullptr.

Any thoughts on this one? The fix seems quite straight-forward, but I know there was a lot of discussion about None vs "" in the past (and I unfortunately don't remember the outcome of that, nor I was able to find those discussions), so I want to make sure I'm doing the right thing here...

Tue, Aug 13, 7:46 AM · Restricted Project
labath accepted D63165: Initial support for native debugging of x86/x64 Windows processes.

This looks great to me. Thank you for your patience.

Tue, Aug 13, 7:38 AM · Restricted Project, Restricted Project

Mon, Aug 12

labath retitled D65643: raw_ostream: add operator<< overload for std::error_code from unittests: Add a (centralized) ability to match std::error_code to raw_ostream: add operator<< overload for std::error_code.
Mon, Aug 12, 1:56 AM · Restricted Project
labath updated the diff for D65643: raw_ostream: add operator<< overload for std::error_code.

Thanks for the feedback. I've redone the patch to add a std::error_code overload
to llvm::raw_ostream. This makes using std::error_code in tests "almost just
work", with the "almost" being there due to the ASSERT_TRUE problem.

Mon, Aug 12, 1:52 AM · Restricted Project
labath added a comment to D65952: SymbolVendor: Have plugins return symbol files directly.

So I am confused. Are we keeping SymbolVendor around for locating symbols files or are we getting rid of it entirely?

Mon, Aug 12, 1:07 AM
labath added a comment to D63165: Initial support for native debugging of x86/x64 Windows processes.

I am still waiting for the g_private_reg_interface thingy to be removed, or for an explanation of why it cannot be done...

Mon, Aug 12, 12:36 AM · Restricted Project, Restricted Project

Fri, Aug 9

labath committed rGaf1744cd6e8a: Minidump/Windows: Fix module lookup (authored by labath).
Minidump/Windows: Fix module lookup
Fri, Aug 9, 2:14 AM
labath committed rL368416: Minidump/Windows: Fix module lookup.
Minidump/Windows: Fix module lookup
Fri, Aug 9, 2:14 AM
labath closed D65955: Minidump/Windows: Fix module lookup.
Fri, Aug 9, 2:13 AM · Restricted Project
labath resigned from D42206: If kevent() is interrupted by signal (or is being debugged) and we get EINTR, retry.
Fri, Aug 9, 2:09 AM · Restricted Project, Restricted Project
labath resigned from D43048: [lldb-test/WIP] Allow a way to test autocompletion.
Fri, Aug 9, 2:09 AM
labath resigned from D42950: LLDB fails to build.
Fri, Aug 9, 2:09 AM · Restricted Project
labath resigned from D44041: Only replace object file sections when non-empty.
Fri, Aug 9, 2:09 AM
labath resigned from D48865: [LLDB] CommandObjectThreadUntil::DoExecute() sets the wrong selected thread ID.
Fri, Aug 9, 2:09 AM
labath resigned from D45106: [Build] Use LIBXML2_LIBRARIES from find_package.
Fri, Aug 9, 2:09 AM · Restricted Project
labath resigned from D47232: Break dependency from Expression -> Commands.
Fri, Aug 9, 2:09 AM
labath resigned from D50525: [WIP] Move lldb-mi interpreter tests to LIT.
Fri, Aug 9, 2:04 AM · Restricted Project
labath resigned from D53662: Give the SymbolFile plugin enough information to efficiently do exact match lookups.
Fri, Aug 9, 2:03 AM
labath resigned from D54053: [NativePDB] Add the ability to create clang record decls from mangled names..
Fri, Aug 9, 2:03 AM
labath resigned from D54731: [lit] Enable the use of custom user-defined lit commands.
Fri, Aug 9, 2:03 AM · Restricted Project
labath resigned from D54883: [Support/FileSystem] Use st_atimespec only when __APPLE__ is defined.
Fri, Aug 9, 2:03 AM · Restricted Project
labath resigned from D55142: Minidump debugging using the native PDB reader.
Fri, Aug 9, 2:03 AM · Restricted Project
labath resigned from D56010: [NativePDB] Fix setting breakpoint by file and line.
Fri, Aug 9, 2:01 AM
labath resigned from D56737: [SymbolFile] Split ParseVariablesForContext into two functions..
Fri, Aug 9, 2:00 AM
labath resigned from D56615: [SymbolFile] Remove the SymbolContext parameter from FindNamespace.
Fri, Aug 9, 2:00 AM
labath resigned from D56614: [SymbolFile] Change ParseFunctionBlocks(SymbolContext&) to ParseBlocksRecursive(Function&).
Fri, Aug 9, 2:00 AM
labath resigned from D56618: [SymbolFile] Remove the SymbolContext parameter from FindTypes.
Fri, Aug 9, 2:00 AM
labath resigned from D59430: Update DwarfDebugInfoEntry to use llvm::Error and llvm::Expected.
Fri, Aug 9, 2:00 AM
labath resigned from D59651: Move DebugRanges() function from SymbolFileDWARF to DWARFContext.
Fri, Aug 9, 1:58 AM
labath abandoned D44680: [dotest] Remove test build directories for passing tests.
Fri, Aug 9, 1:57 AM
labath abandoned D62948: lit/Register: Avoid stdio in register write tests.
Fri, Aug 9, 1:56 AM
labath resigned from D43912: [Symbol] Add InvalidTypeError, a force-checked recoverable error.
Fri, Aug 9, 1:56 AM
labath resigned from D57402: build: remove custom variables.
Fri, Aug 9, 1:54 AM · Restricted Project
labath added a comment to D63868: Unify+fix remote XML libraries handling with the legacy one.

This should be no longer relevant, right?

Fri, Aug 9, 1:52 AM · Restricted Project
labath resigned from D32167: Add support for type units (.debug_types) to LLDB in a way that is compatible with DWARF 5.
Fri, Aug 9, 1:52 AM
labath accepted D65932: [lldb] Fix dynamic_cast by no longer failing on variable without metadata.

Thanks. I still don't know much about this, but I am very happy that we're able to fix stuff by deleting code. We can always revisit this decision if we run into problems later on..

Fri, Aug 9, 1:27 AM · Restricted Project, Restricted Project
labath added a comment to D65955: Minidump/Windows: Fix module lookup.

I'm curious, though, where is the matching code? Should "unknown" be treated as a wildcard when trying to find the matching module?

Fri, Aug 9, 1:20 AM · Restricted Project
labath planned changes to D63713: Add error handling to the DataExtractor class.

Yeah, I noticed that go by (pretty good stuff btw), but I didn't get around to updating this yet..

Fri, Aug 9, 1:02 AM · Restricted Project
labath accepted D65942: Disallow implicit conversion from pointers to bool in llvm::toStringRef.

It seems everybody agrees that this is the way forward.

Fri, Aug 9, 1:00 AM · Restricted Project, Restricted Project
Herald added a reviewer for D65949: unittests: Use yaml2obj as a library instead of an external process: espindola.

I can see the appeal of having the contents next to the logic that is testing it, but I'm somewhat concerned for the cases where it includes +1000 lines of YAML in the test file. I think for those cases it might make sense to consider these fixtures and be in their own file?

Fri, Aug 9, 12:45 AM
labath updated the diff for D65949: unittests: Use yaml2obj as a library instead of an external process.
  • put back the line entry test input into an external file
Fri, Aug 9, 12:36 AM

Thu, Aug 8

labath added inline comments to D65986: Allow setting the VFS to 'real' mode instead of default 'physical'.
Thu, Aug 8, 11:46 PM · Restricted Project
labath created D65955: Minidump/Windows: Fix module lookup.
Thu, Aug 8, 8:44 AM · Restricted Project
labath created D65952: SymbolVendor: Have plugins return symbol files directly.
Thu, Aug 8, 7:30 AM
labath accepted D65798: [lldb][CMake] Infer `Clang_DIR` if not passed explicitly.

I'm happy with this, and it looks very nice and idiomatic, but maybe wait for @compnerd a bit, as he had some reservations about the whole thing..

Thu, Aug 8, 6:53 AM · Restricted Project
labath created D65949: unittests: Use yaml2obj as a library instead of an external process.
Thu, Aug 8, 6:31 AM
labath committed rG88c77d6752ca: ObjectFileELF: Convert a unit test to a lit test (authored by labath).
ObjectFileELF: Convert a unit test to a lit test
Thu, Aug 8, 5:58 AM
labath committed rL368289: ObjectFileELF: Convert a unit test to a lit test.
ObjectFileELF: Convert a unit test to a lit test
Thu, Aug 8, 5:58 AM
labath added a reviewer for D65942: Disallow implicit conversion from pointers to bool in llvm::toStringRef: dblaikie.

+@dblaikie. I know who would the llvm owner here be, but he's probably close enough.

Thu, Aug 8, 5:43 AM · Restricted Project, Restricted Project
labath added a comment to D65932: [lldb] Fix dynamic_cast by no longer failing on variable without metadata.

I'm not very familiar with this code, so I don't really understand what kind of rewriting it does, or what is this metadata thing, but...... what if we turn this around somehow? What are the circumstances under which we don't find metadata for a global variable and we definitely *do* want to report this as an error?

Thu, Aug 8, 5:08 AM · Restricted Project, Restricted Project
labath committed rG0de33de81338: Fix LLDB_CONFIGURATION_DEBUG builds for the GetSymbolVendor removal (authored by labath).
Fix LLDB_CONFIGURATION_DEBUG builds for the GetSymbolVendor removal
Thu, Aug 8, 4:52 AM
labath committed rL368279: Fix LLDB_CONFIGURATION_DEBUG builds for the GetSymbolVendor removal.
Fix LLDB_CONFIGURATION_DEBUG builds for the GetSymbolVendor removal
Thu, Aug 8, 4:49 AM
labath added a comment to D65939: [lldb][CMake] Add LLDB_ENABLE_WERROR option.

So, why doesn't LLVM_ENABLE_WERROR suffice? It looks like that ought to work even in standalone builds...

Thu, Aug 8, 4:28 AM · Restricted Project
labath added a comment to D65932: [lldb] Fix dynamic_cast by no longer failing on variable without metadata.

(and it won't work on windows, because the msvc demangler will demangle this as "struct Base `RTTI Type Descriptor'")

Thu, Aug 8, 3:12 AM · Restricted Project, Restricted Project
labath added a comment to D65932: [lldb] Fix dynamic_cast by no longer failing on variable without metadata.

This looks like a very hacky way to achieve something. Isn't there some better way to detect this situation? Maybe something to do with the linkage type of these variables?

Thu, Aug 8, 3:03 AM · Restricted Project, Restricted Project
labath committed rG6db975b7b89d: Add a missing include to SymbolFilePDBTests.cpp (authored by labath).
Add a missing include to SymbolFilePDBTests.cpp
Thu, Aug 8, 2:44 AM
labath committed rL368271: Add a missing include to SymbolFilePDBTests.cpp.
Add a missing include to SymbolFilePDBTests.cpp
Thu, Aug 8, 2:42 AM
labath committed rGbac7862c008e: Remove xcode-specific Config.h (authored by labath).
Remove xcode-specific Config.h
Thu, Aug 8, 1:29 AM
labath committed rL368266: Remove xcode-specific Config.h.
Remove xcode-specific Config.h
Thu, Aug 8, 1:29 AM
labath closed D65862: Remove xcode-specific Config.h.
Thu, Aug 8, 1:29 AM · Restricted Project
labath committed rG959e603456f9: Fix PDB unit tests for the GetSymbolVendor deletion (authored by labath).
Fix PDB unit tests for the GetSymbolVendor deletion
Thu, Aug 8, 1:23 AM
labath committed rL368265: Fix PDB unit tests for the GetSymbolVendor deletion.
Fix PDB unit tests for the GetSymbolVendor deletion
Thu, Aug 8, 1:23 AM
labath requested changes to D65927: ObjectFileELF: delete local NT_* macro definitions.

I think you need to update your local checkout. I just deleted these yesterday. :)

Thu, Aug 8, 1:12 AM
labath committed rG579d6d1aa597: Remove Module::GetSymbolVendor (authored by labath).
Remove Module::GetSymbolVendor
Thu, Aug 8, 12:34 AM