summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [lldb] [Process] Introduce common helpers to split/recombine YMM dataMichal Gorny2019-06-211-28/+8
| | | | | | | | | | | | | | | | | Introduce two common helpers to take care of splitting and recombining YMM registers to/from XSAVE-like data. Since FreeBSD, Linux and NetBSD all use XSAVE-like data structures but with potentially different field layouts, the function takes two pointers -- to XMM register and to YMM high bits, and copies the data from/to YMMReg type. While at it, remove support for big endian. To mine and Pavel Labath's combined knowledge, there is no such thing on x86. Furthermore, assuming that the YMM register data would be swapped for big endian seems to be a weird assumption. Differential Revision: https://reviews.llvm.org/D63610 llvm-svn: 364042
* [lldb] NFC modernize codebase with modernize-use-nullptrKonrad Kleine2019-05-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: NFC = [[ https://llvm.org/docs/Lexicon.html#nfc | Non functional change ]] This commit is the result of modernizing the LLDB codebase by using `nullptr` instread of `0` or `NULL`. See https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html for more information. This is the command I ran and I to fix and format the code base: ``` run-clang-tidy.py \ -header-filter='.*' \ -checks='-*,modernize-use-nullptr' \ -fix ~/dev/llvm-project/lldb/.* \ -format \ -style LLVM \ -p ~/llvm-builds/debug-ninja-gcc ``` NOTE: There were also changes to `llvm/utils/unittest` but I did not include them because I felt that maybe this library shall be updated in isolation somehow. NOTE: I know this is a rather large commit but it is a nobrainer in most parts. Reviewers: martong, espindola, shafik, #lldb, JDevlieghere Reviewed By: JDevlieghere Subscribers: arsenm, jvesely, nhaehnle, hiraditya, JDevlieghere, teemperor, rnkovacs, emaste, kubamracek, nemanjai, ki.stfu, javed.absar, arichardson, kbarton, jrtc27, MaskRay, atanasyan, dexonsmith, arphaman, jfb, jsji, jdoerfert, lldb-commits, llvm-commits Tags: #lldb, #llvm Differential Revision: https://reviews.llvm.org/D61847 llvm-svn: 361484
* Replace 'ap' with 'up' suffix in variable names. (NFC)Jonas Devlieghere2019-02-131-4/+4
| | | | | | | | | | | | | | | | | The `ap` suffix is a remnant of lldb's former use of auto pointers, before they got deprecated. Although all their uses were replaced by unique pointers, some variables still carried the suffix. In r353795 I removed another auto_ptr remnant, namely redundant calls to ::get for unique_pointers. Jim justly noted that this is a good opportunity to clean up the variable names as well. I went over all the changes to ensure my find-and-replace didn't have any undesired side-effects. I hope I didn't miss any, but if you end up at this commit doing a git blame on a weirdly named variable, please know that the change was unintentional. llvm-svn: 353912
* 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-1/+1
| | | | | | | | | | | 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
* Move RegisterValue,Scalar,State from Core to UtilityPavel Labath2018-08-071-2/+2
| | | | | | | | | | | | | These three classes have no external dependencies, but they are used from various low-level APIs. Moving them down to Utility improves overall code layering (although it still does not break any particular dependency completely). The XCode project will need to be updated after this change. Differential Revision: https://reviews.llvm.org/D49740 llvm-svn: 339127
* Reflow paragraphs in comments.Adrian Prantl2018-04-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is intended as a clean up after the big clang-format commit (r280751), which unfortunately resulted in many of the comment paragraphs in LLDB being very hard to read. FYI, the script I used was: import textwrap import commands import os import sys import re tmp = "%s.tmp"%sys.argv[1] out = open(tmp, "w+") with open(sys.argv[1], "r") as f: header = "" text = "" comment = re.compile(r'^( *//) ([^ ].*)$') special = re.compile(r'^((([A-Z]+[: ])|([0-9]+ )).*)|(.*;)$') for line in f: match = comment.match(line) if match and not special.match(match.group(2)): # skip intentionally short comments. if not text and len(match.group(2)) < 40: out.write(line) continue if text: text += " " + match.group(2) else: header = match.group(1) text = match.group(2) continue if text: filled = textwrap.wrap(text, width=(78-len(header)), break_long_words=False) for l in filled: out.write(header+" "+l+'\n') text = "" out.write(line) os.rename(tmp, sys.argv[1]) Differential Revision: https://reviews.llvm.org/D46144 llvm-svn: 331197
* Reduce x86 register context boilerplate.Pavel Labath2017-12-181-8/+8
| | | | | | | | | | | | | | | | | | | | | | Summary: The x86 FPR struct was defined as a struct containing a union between two members: XSAVE and FXSAVE. This patch makes FPR a union directly to remove one layer of indirection when trying to access the members. The initial layout of these two structs is identical, which is recognised by the fact that XSAVE has FXSAVE as its first member, so we also considered removing one more layer and leave FPR identical to XSAVE struct, but stopped short of doing that, as the FPR may be used to store different layouts in the future (e.g., ones generated by the FSAVE instruction). Reviewers: clayborg, krytarowski Subscribers: emaste, lldb-commits Differential Revision: https://reviews.llvm.org/D41245 llvm-svn: 320966
* Kill struct IOVECPavel Labath2017-12-011-6/+0
| | | | | | | | | | | struct iovec is used as an interface to system (posix) api's. As such, we shouldn't be using it in os-independent code, and we shouldn't be defining our own iovec replacements. Fortunately, its usage was not very widespread, so the removal was very easy -- I simply moved a couple declarations into os-specific code. llvm-svn: 319536
* Move DataBuffer / DataExtractor and friends from Core -> Utility.Zachary Turner2017-03-041-2/+2
| | | | llvm-svn: 296943
* Remove dependencies from Utility to Core and Target.Zachary Turner2017-02-141-2/+2
| | | | | | | | | | With this patch, the only dependency left is from Utility to Host. After this is broken, Utility will finally be standalone. Differential Revision: https://reviews.llvm.org/D29909 llvm-svn: 295088
* Remove a spurious reference to ProcessElfCorePavel Labath2016-11-301-6/+1
| | | | | | | | | | | We were referencing a the process class from a register context, which seems intuitively wrong. Also, the comment above that code is now definitely incorrect, as ProcessElfCore now does support floating point registers. Also, the code wasn't really doing anything, as it was just skipping a zero-initialization of a field that was most likely zero-initialized anyway. Linux elf core FPR test still passes after this. llvm-svn: 288237
* Remove an x86-ism from RegisterInfoInterfacePavel Labath2016-11-301-1/+1
| | | | | | | | | | | | | | | | | Summary: While adding FPR support to x86 elf core files (D26300), we ended up adding a very x86-specific function to the general RegisterInfoInterface class, which I didn't catch in review. This removes that function. The only reason we needed it was to find the offset of the FXSAVE area. This is the same as the offset of the first register within that area, so we might as well use that. Reviewers: clayborg, dvlahovski Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D27222 llvm-svn: 288236
* ELF core: Adding parsing of the floating-point and SSE registers on x86 ↵Dimitar Vlahovski2016-11-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 32/64 bit elf core files Summary: The floating-point and SSE registers could be present in the elf-core file in the note NT_FPREGSET for 64 bit ones, and in the note NT_PRXFPREG for 32 bit ones. The entire note is a binary blob matching the layout of the x87 save area that gets generated by the FXSAVE instruction (see Intel developers manual for more information). This CL mainly modifies the RegisterRead function in RegisterContextPOSIXCore_x86_64 for it to return the correct data both for GPR and FPR/SSE registers, and return false (meaning "this register is not available") for other registers. I added a test to TestElfCore.py that tests reading FPR/SSE registers both from a 32 and 64 bit elf-core file and I have inluded the source which I used to generate the core files. I tried to also add support for the AVX registers, because this info could also be present in the elf-core file (note NT_X86_XSTATE - that is the result of the newer XSAVE instruction). Parsing the contents from the file is easy. The problem is that the ymm registers are split into two halves and they are in different places in the note. For making this work one would either make a "hacky" approach, because there won't be any other way with the current state of the register contexts - they assume that "this register is of size N and at offset M" and don't have the notion of discontinuos registers. Reviewers: labath Subscribers: emaste, lldb-commits Differential Revision: https://reviews.llvm.org/D26300 llvm-svn: 287506
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-573/+462
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Rename lldb registers to contain lldb_ prefix.Zachary Turner2014-11-211-289/+289
| | | | | | | | | | | | | | | | | | | | LLDB supports many different register numbering schemes, and these are typically prefixed with an indicator that lets the user know what numbering scheme is used. The gcc numbering scheme is prefixed with gcc, and there are similar ones for dwarf, gdb, and gcc_dwarf. LLDB also contains its own internal numbering scheme, but the enum for LLDB's numbering scheme was prefixed differently. This patch changes the names of these enums to use the same naming scheme for the enum values as the rest of the register kinds by removing gpr_ and fpu_ prefixes, and instead using lldb_ prefixes for all enum values. Differential Revision: http://reviews.llvm.org/D6351 Reviewed by: Greg Clayton llvm-svn: 222495
* Replace uint32_t by lldb::RegisterKing in register context API.Jean-Daniel Dupas2014-07-021-2/+2
| | | | llvm-svn: 212172
* Properly terminated POSIX register sets with LLDB_INVALID_REGNUM.Todd Fiala2014-06-141-11/+17
| | | | | | | | | | RegisterSets are assumed to be terminated by this value. Loops over register set values would fail without LLDB_INVALID_REGNUM terminating the list. This change adjusts the static check to account for the size of the register set regnum list being one larger than the expected valid register set count. llvm-svn: 210964
* Switch over to use the ArchSpec::GetMachine() instead of ArchSpec::GetCore() ↵Greg Clayton2014-03-201-10/+6
| | | | | | to keep the code more portable as we add new core types to ArchSpec. llvm-svn: 204400
* Moved various RegisterContext files from Process/POSIX to Process/Utility ↵Virgile Bello2014-03-121-0/+665
for easier sharing. Fix Windows build by adding JITLoaderGDB and ProcessElfCore. RegisterContext: fixes for Windows build: sizeof(GPR::register) didn't work, switched to sizeof(((GPR*)NULL)->register). llvm-svn: 203667
OpenPOWER on IntegriCloud