summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/Utility/LogTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [lit] Fix several tests that fail when using Python 3 or on WindowsStella Stamenova2018-05-141-6/+11
| | | | | | | | | | | | | | | | Summary: 1) In logtest.cpp, the name of the file that is reported is not always capitalized, so split the comparison to validate the file (case insensitive) and function (case sensitive) separately 2) Update the gdb remote client tests to work with Python 3. In Python 3, socket sends/receives data as bytes rather than byte strings. This also updates the usage of .hex() - this is no longer available in Python 3, so use hexlify instead Reviewers: asmith, labath, zturner Reviewed By: labath Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46773 llvm-svn: 332293
* Add LLDB_LOG_ERROR macroPavel Labath2018-01-301-0/+17
| | | | | | | | | | | | | | | | Summary: The difference between this and regular LLDB_LOG is that this one clears the error object unconditionally. This was inspired by the ObjectFileELF bug (r322664), where the error object was being cleared only if logging was enabled. Reviewers: davide, zturner, jingham, clayborg Subscribers: lldb-commits, emaste Differential Revision: https://reviews.llvm.org/D42182 llvm-svn: 323753
* Simplify some LogTest testsPavel Labath2018-01-171-78/+90
| | | | | | | | | | | This removes boilerplate for setting up a log channel and capturing the output from some of the tests. I do this by moving the setup code into a test fixture and adding a logAndTakeOutput utility function to log some string and then retrieve it from the log. I also use some googlemock goodies to simplify a couple of assertions. llvm-svn: 322653
* Remove lldb streams from the Log class completelyPavel Labath2017-03-151-49/+65
| | | | | | | | | | | | | | | | | | | | | Summary: previously we switched to llvm streams for log output, this completes the switch for the error streams. I also clean up the includes and remove the unused argument from DisableAllLogChannels(). This required adding a bit of boiler plate to convert the output in the command interpreter, but that should go away when we switch command results to use llvm streams as well. Reviewers: zturner, eugene Subscribers: lldb-commits, emaste Differential Revision: https://reviews.llvm.org/D30894 llvm-svn: 297812
* Fix remaining threading issues in Log.hPavel Labath2017-03-091-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes two threading issues in the logging code. The access to the mask and options flags had data races when we were trying to enable/disable logging while another thread was writing to the log. Since we can log from almost any context, and we want it to be fast, so I avoided locking primitives and used atomic variables instead. I have also removed the (unused) setters for the mask and flags to make sure that the only way to set them is through the enable/disable channel functions. I also add tests, which when run under tsan, verify that the use cases like "doing an LLDB_LOGV while another thread disables logging" are data-race-free. Reviewers: zturner, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D30702 llvm-svn: 297368
* Update log_options unit testPavel Labath2017-03-061-36/+41
| | | | | | | | | | it was accessing the details of the Log class directly. Let it go through the channel class instead. This also discovered a bug when we were setting but not clearing the log options when enabling a channel. llvm-svn: 297053
* Fix Log unit testsPavel Labath2017-03-061-3/+2
| | | | | | | the llvm function for getting the thread name dropped the _np suffix during review. Zachary's commit did not reflect that. llvm-svn: 297013
* Move Log from Core -> Utility.Zachary Turner2017-03-031-0/+212
All references to Host and Core have been removed, so this class can now safely be lowered into Utility. Differential Revision: https://reviews.llvm.org/D30559 llvm-svn: 296909
OpenPOWER on IntegriCloud