summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-101-4/+0
| | | | | | | | | | | | | | | | | | | | | | | A lot of comments in LLDB are surrounded by an ASCII line to delimit the begging and end of the comment. Its use is not really consistent across the code base, sometimes the lines are longer, sometimes they are shorter and sometimes they are omitted. Furthermore, it looks kind of weird with the 80 column limit, where the comment actually extends past the line, but not by much. Furthermore, when /// is used for Doxygen comments, it looks particularly odd. And when // is used, it incorrectly gives the impression that it's actually a Doxygen comment. I assume these lines were added to improve distinguishing between comments and code. However, given that todays editors and IDEs do a great job at highlighting comments, I think it's worth to drop this for the sake of consistency. The alternative is fixing all the inconsistencies, which would create a lot more churn. Differential revision: https://reviews.llvm.org/D60508 llvm-svn: 358135
* 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
* Simplify Boolean expressionsJonas Devlieghere2018-12-151-5/+2
| | | | | | | | | | | This patch simplifies boolean expressions acorss LLDB. It was generated using clang-tidy with the following command: run-clang-tidy.py -checks='-*,readability-simplify-boolean-expr' -format -fix $PWD Differential revision: https://reviews.llvm.org/D55584 llvm-svn: 349215
* Upstreaming avx512 register support in debugserver. These changesJason Molenda2018-03-061-19/+359
| | | | | | | | | | | | | | | | | | | were originally written by Chris Bieneman, they've undergone a number of changes since then. Also including the debugserver bridgeos support, another arm environment that runs Darwin akin to ios. These codepaths are activated when running in a bridgeos environment which we're not set up to test today. There's additional (small) lldb changes to handle bridgeos binaries that still need to be merged up. Tested on a darwin system with avx512 hardware and without. <rdar://problem/36424951> llvm-svn: 326756
* Fix misc -Wcast-qual warnings, NFCVedant Kumar2017-12-061-2/+2
| | | | llvm-svn: 319937
* Change the ftag x87 register from being 8-bits wide to 16-bits wideJason Molenda2017-08-241-4/+4
| | | | | | | | to match the changes Saleem Abdulrasool committed in r311579. Fixes a testsuite failure now that the testsuite expects a 16 bit return value for thsi reg. llvm-svn: 311627
* [debugserver] NFC. Cleanup Get/Set Register Value/ContextChris Bieneman2017-03-141-572/+310
| | | | | | This patch modifies the Get/Set Register Value/Context functions for Intel to not duplicate code for reading non-AVX registers. This is similar to other transformations I've been making to the AVX register handling code. llvm-svn: 297787
* [debugserver] NFC. Missed one bit of cleanup in r297688Chris Bieneman2017-03-131-22/+13
| | | | | | I did this cleanup in the x86_64, but missed it in the i386 code. This just simplifies the calls to thread_get_state. llvm-svn: 297691
* [debugserver] NFC. Cleanup DNBArchImpl*::GetFPUState()Chris Bieneman2017-03-131-100/+51
| | | | | | | | This patch consolidates the DEBUG_FPU_REGS code for i386 and x86_64 to take advantage of the fact that the non-AVX members of the avx register state structure overlap with the standard fpu register state structure. This reduces the amount of code required to set debug values into the register state structures because the register state structures are stored in a union. llvm-svn: 297688
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-1685/+2154
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* A partner to the cleanup in r247741, change the variables names inJason Molenda2015-09-151-126/+126
| | | | | | | | | | | | | | debugserver to match. "gcc" is now "ehframe" and "gdb" is now "debugserver". Because this is debugserver, what we call the Process Plugin register numbers up in lldb are the debugserver register numbers down here - they are the register numbers that debugserver will use to refer to these registers over the gdb-remote protocol. debugserver was already reporting the registers with the key "ehframe"; this change is just cleaning up the internal variable names to match. llvm-svn: 247751
* [debugserver] Fix "control may reach end of non-void function" warnings.Bruce Mitchener2015-08-041-4/+5
| | | | | | | | | | Reviewers: clayborg, jingham Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11745 llvm-svn: 243953
* Add UNUSED_IF_ASSERT_DISABLED and apply it.Bruce Mitchener2015-07-241-2/+2
| | | | | | | | | | | | | | | Summary: This replaces (void)x; usages where they x was subsequently involved in an assertion with this macro to make the intent more clear. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11451 llvm-svn: 243074
* Fix warnings.Bruce Mitchener2015-07-221-1/+3
| | | | | | | | | | Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11404 llvm-svn: 242913
* Fix debugserver warnings on MacOSX.Greg Clayton2015-03-091-5/+5
| | | | llvm-svn: 231692
* Add comment explaining the dwarf v. eh_frame register numbering usedJason Molenda2014-08-131-1/+6
| | | | | | on i386 darwin. llvm-svn: 215484
* Fix typos.Bruce Mitchener2014-07-081-2/+2
| | | | llvm-svn: 212553
* Revert the debugserver part of r211868. While formally a fine change, ↵Jim Ingham2014-06-271-7/+5
| | | | | | | | | debugserver doesn't depend on llvm (it really doesn't even depend on anything in lldb) and this nicety isn't worth adding that dependence. llvm-svn: 211903
* lldb: remove adhoc implementation of array_sizeofSaleem Abdulrasool2014-06-271-5/+7
| | | | | | | | Replace adhoc inline implementation of llvm::array_lengthof in favour of the implementation in LLVM. This is simply a cleanup change, no functional change intended. llvm-svn: 211868
* Fixes to get the arm native debugserver building again.Jason Molenda2013-11-211-1/+1
| | | | | | Fix a small typeo in the i386/x86_64 debugserver plugins. llvm-svn: 195308
* <rdar://problem/15172417>Greg Clayton2013-11-131-0/+58
| | | | | | | | | | | | | | | Added two new GDB server packets to debugserver: "QSaveRegisterState" and "QRestoreRegiterState". "QSaveRegisterState" makes the remote GDB server save all register values and it returns a save identifier as an unsigned integer. This packet can be used prior to running expressions to save all registers. All registers can them we later restored with "QRestoreRegiterState:SAVEID" what SAVEID is the integer identifier that was returned from the call to QSaveRegisterState. Cleaned up redundant code in lldb_private::Thread, lldb_private::ThreadPlanCallFunction. Moved the lldb_private::Thread::RegisterCheckpoint into its own header file and it is now in the lldb_private namespace. Trimmed down the RegisterCheckpoint class to omit stuff that wasn't used (the stack ID). Added a few new virtual methods to lldb_private::RegisterContext that allow subclasses to efficiently save/restore register states and changed the RegisterContextGDBRemote to take advantage of these new calls. llvm-svn: 194621
* Fixed up registers in debugserver.Greg Clayton2013-11-091-34/+206
| | | | | | | | | | | | - removed all gaps from the g/G packets - optimized registers for x86_64 to not send/receive xmm0-xmm15 as well as ymm0-ymm15, now we only send ymm0-15 and xmm0-15 are now pseudo regs - Fixed x86_64 floating point register gaps - Fixed x86_64 so that xmm8-xmm15 don't overlap with ymm0-ymm3. This could lead to bad values showing in the debugger and was due to bad register info structure contents - Fixed i386 so we only send ymm0-ymm7 and xmm0-xmm7 are now pseudo regs. - Fixed ARM register definitions to not have any gaps - Fixed it so value registers and invalidation registers are specified using register names which avoid games we had to play with register numbering in the ARM plugin. llvm-svn: 194302
* Get debugserver to call task_set_state to prime the control registers so ↵Jim Ingham2013-07-111-29/+14
| | | | | | | | | | | | | that watchpoints take for threads created while the program is running. Remove the testcase skips from TestConcurrentEvents.py, since they all pass now, and fix TestWatchpointMultipleThreads.py - which should have caught this problem - so it doesn't artificially break on new thread creation before the watchpoint triggers. llvm.org/pr16566 <rdar://problem/14383244> llvm-svn: 186132
* Huge performance improvements when one breakpoint contains many locations.Greg Clayton2013-06-121-2/+2
| | | | | | | | | | 325,000 breakpoints for running "breakpoint set --func-regex ." on lldb itself (after hitting a breakpoint at main so that LLDB.framework is loaded) used to take up to an hour to set, now we are down under a minute. With warm file caches, we are at 40 seconds, and that is with setting 325,000 breakpoint through the GDB remote API. Linux and the native debuggers might be faster. I haven't timed what how much is debug info parsing and how much is the protocol traffic to/from GDB remote. That there were many performance issues. Most of them were due to storing breakpoints in the wrong data structures, or using the wrong iterators to traverse the lists, traversing the lists in inefficient ways, and not optimizing certain function name lookups/symbol merges correctly. Debugging after that is also now very efficient. There were issues with replacing the breakpoint opcodes in memory that was read, and those routines were also fixed. llvm-svn: 183820
* Change debugserver from using the mach port number (in debugserver'sJason Molenda2013-02-221-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | own port namepsace) as the thread identifier to using the system-wide globally unique thread id as the thread identifier number. MachThread.cpp keeps both the unique id and the mach port number for each thread. All layers outside MachThread class use the unique id with three exceptions: (1) Mach exceptions come in with the port number (thread_port) which needs to be translated, (2) any calls to low-level thread_get_state/thread_set_state/thread_suspend etc need to use the mach port number, (3) MachThreadList::UpdateThreadList which creates the MachThread objects gets the unique id and passes it to the MachThread ctor as an argument. In general, any time nub_thread_t is used, it is now referring to a unique thread id. Any time a thread_t is used, it is now referring to a mach port number. There was some interchangability of these types previously. nub_thread_t has also been changed to a 64-bit type which necessitated some printf specification string changes. I haven't been able to test these changes extensively yet but want to checkpoint the work. The scenarios I've been testing are all working correctly so while there may be some corner cases I haven't hit yet, I think it is substantially correct. <rdar://problem/12931414> llvm-svn: 175870
* Added all of the 16 and 8 bit register variants for i386.Greg Clayton2013-01-211-84/+146
| | | | | | Modified the ARM register context to invalidate r8 - r14 when the CPSR register is modified. llvm-svn: 173104
* Fix a logic error in the condition for a warning log message.Jim Ingham2013-01-141-1/+1
| | | | llvm-svn: 172442
* Stop using the "%z" size_t modifier and cast all size_t values to uint64_t. ↵Greg Clayton2012-09-181-9/+9
| | | | | | Some platforms don't support this modification. llvm-svn: 164148
* rdar://problem/11320188Johnny Chen2012-06-011-6/+44
| | | | | | | | | Designate MachThreadList as a transaction coordinator when doing Enable/DisableHardwareWatchpoint on the list of threads. In case the operation (iterating on the threads and doing enable/disable) fails in the middle, we rollback the already enabled/disabled threads to their checkpointed states. When all the threads succeed in enable/disable, we ask each thread to finsih the transaction and commit the change of the debug state. llvm-svn: 157858
* For hardware watchpoint enable/disable, in case the kernel call to set the ↵Johnny Chen2012-05-311-1/+7
| | | | | | revised debug state fails, we need to recover the local cache to the previous known state. llvm-svn: 157778
* Remove a ton of implicit narrowing conversions for C++11 compatibility.Benjamin Kramer2012-02-211-80/+80
| | | | llvm-svn: 151071
* Move CPUHasAVX() prototype out of an #ifdef block of code.Jason Molenda2011-12-081-2/+2
| | | | llvm-svn: 146198
* <rdar://problem/10544202>Greg Clayton2011-12-081-3/+2
| | | | | | Fixed detection of AVX on darwin now that our kernel supports it. llvm-svn: 146135
* Enabled the "printf" attribute on all debugserver logging functions and fixed Greg Clayton2011-10-281-3/+3
| | | | | | the ensuing mayhem. llvm-svn: 143244
* Modify the delegation chain from MachThreadList -> MachThread -> ↵Johnny Chen2011-09-291-3/+26
| | | | | | | | | | | | | | DNBArchProtocol so that when the watchpoint state is changed, not only does the change propagate to all the thread instances, it also updates a global debug state, if chosen by the DNBArchProtocol derivative. Once implemented, the DNBArchProtocol derivative, also makes sure that when new thread comes along, it tries to inherit from the global debug state, if it is valid. Modify TestWatchpointMultipleThreads.py to test this functionality. llvm-svn: 140811
* Convert lldb::ModuleSP to use an instrusive ref counted pointer.Greg Clayton2011-09-171-1/+2
| | | | | | | | | We had some cases where getting the shared pointer for a module from the global module list was causing a performance issue when debugging with DWARF in .o files. Now that the module uses intrusive ref counts, we can easily convert any pointer to a shared pointer. llvm-svn: 139983
* Added more logging, and renamed FPR to FPU in a the register set/flavor enum.Greg Clayton2011-09-171-9/+37
| | | | llvm-svn: 139982
* Foe x86_64/i386, piggyback the hardware index of the fired watchpoint in the ↵Johnny Chen2011-09-171-0/+4
| | | | | | | | | | exception data sent back to the debugger. On the debugger side, use the opportunity during the StopInfoMachException::CreateStopReasonWithMachException() method to set the hardware index for the very watchpoint location. llvm-svn: 139975
* Update I386 DNB impl to fix the same errors as DNBArchImplX86_64: ('==' ↵Johnny Chen2011-09-131-12/+12
| | | | | | instead of '=') and (by value instead of by reference). llvm-svn: 139667
* Reset the debug status register, only if necessary, before we resume,Johnny Chen2011-09-091-5/+14
| | | | | | which saves unnecessary traffic to the kernel. llvm-svn: 139410
* Added comments about exception code.Johnny Chen2011-09-081-0/+2
| | | | llvm-svn: 139294
* Add logic to the DNBArchImplX86_64/DNBArchImplI386::NotifyException() ↵Johnny Chen2011-09-081-23/+56
| | | | | | | | | | | | | callback method in order to distinguish the real single step exception from a watchpoint exception which uses the same exc_type of EXC_BREAKPOINT and exc_code of EXC_I386_SGL. This is done by checking the debug status register to find out whether the watchpoint data break event has fired, and, if yes, stuff the data break address into the exception's exc_sub_code field on the debugserver side for lldb to consume on the other end. llvm-svn: 139274
* Watchpoint work in progress:Johnny Chen2011-09-021-0/+34
| | | | | | | | | | | Add a virtual method GetHardwareWatchpointHit() to the DNBArchProtocol base class which consults the architecture to return the watchpoint hit; otherwise return an invalid index. Add impl. of the method to X86_64 and I386 subclasses, plus reset the debug status register before we resume execution of the inferior thread. llvm-svn: 139034
* Renaming: from IsVacantWatchpoint() to IsWatchpointVacant().Johnny Chen2011-08-311-3/+3
| | | | llvm-svn: 138907
* Renamed the helper method to ClearWatchpointHits() for clarity of its purpose.Johnny Chen2011-08-311-1/+1
| | | | llvm-svn: 138899
* Add a couple of helper methods to check/clear the debug status registerJohnny Chen2011-08-311-0/+23
| | | | | | which contains the watchpoint hit information. llvm-svn: 138881
* Fix the shift amount applied to size_and_rw_bits() for debug control register,Johnny Chen2011-08-311-1/+2
| | | | | | which did not take into account the hardware index. llvm-svn: 138867
* Update comments.Johnny Chen2011-08-311-2/+2
| | | | llvm-svn: 138863
* Watchpoint work in progress: add helper methods to DNB arch impl for I386 to ↵Johnny Chen2011-08-311-45/+115
| | | | | | implment Enable/DisableHardwareWatchpoint. llvm-svn: 138847
* Watchpoint work in progress: add helper methods to DNB arch impl for X86_64 ↵Johnny Chen2011-08-311-1/+1
| | | | | | to implment Enable/DisableHardwareWatchpoint. llvm-svn: 138844
OpenPOWER on IntegriCloud