summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/NativeRegisterContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Logging] Replace Log::Printf with LLDB_LOG macro (NFC)Jonas Devlieghere2019-07-241-17/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces explicit calls to log::Printf with the new LLDB_LOGF macro. The macro is similar to LLDB_LOG but supports printf-style format strings, instead of formatv-style format strings. So instead of writing: if (log) log->Printf("%s\n", str); You'd write: LLDB_LOG(log, "%s\n", str); This change was done mechanically with the command below. I replaced the spurious if-checks with vim, since I know how to do multi-line replacements with it. find . -type f -name '*.cpp' -exec \ sed -i '' -E 's/log->Printf\(/LLDB_LOGF\(log, /g' "{}" + Differential revision: https://reviews.llvm.org/D65128 llvm-svn: 366936
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-101-2/+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
* Move RegisterValue,Scalar,State from Core to UtilityPavel Labath2018-08-071-1/+1
| | | | | | | | | | | | | 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-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Clean up NativeRegisterContextPavel Labath2017-11-101-3/+2
| | | | | | | | | | | | | | | | | | | | | Summary: This commit removes the concrete_frame_idx member from NativeRegisterContext and related functions, which was always set to zero and never used. I also change the native thread class to store a NativeRegisterContext as a unique_ptr (documenting the ownership) and make sure it is always initialized (most of the code was already blindly dereferencing the register context pointer, assuming it would always be present -- this makes its treatment consistent). Reviewers: eugene, clayborg, krytarowski Subscribers: aemerson, sdardis, nemanjai, javed.absar, arichardson, kristof.beyls, kbarton, uweigand, alexandreyy, lldb-commits Differential Revision: https://reviews.llvm.org/D39837 llvm-svn: 317881
* Simplify NativeProcessProtocol::GetArchitecture/GetByteOrderPavel Labath2017-11-091-13/+4
| | | | | | | | | | | | | | | | | | | Summary: These functions used to return bool to signify whether they were able to retrieve the data. This is redundant because the ArchSpec and ByteOrder already have their own "invalid" states, *and* because both of the current implementations (linux, netbsd) can always provide a valid result. This allows us to simplify bits of the code handling these values. Reviewers: eugene, krytarowski Subscribers: javed.absar, lldb-commits Differential Revision: https://reviews.llvm.org/D39733 llvm-svn: 317779
* Remove shared pointer from NativeProcessProtocolPavel Labath2017-07-181-38/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The usage of shared_from_this forces us to separate construction and initialization phases, because shared_from_this() is not available in the constructor (or destructor). The shared semantics are not necessary, as we always have a clear owner of the native process class (GDBRemoteCommunicationServerLLDB object). Even if we need shared semantics in the future (which I think we should strongly avoid), reverting this will not be necessary -- the owners can still easily store the native process object in a shared pointer if they really want to -- this just prevents the knowledge of that from leaking into the class implementation. After this a NativeThread object will hold a reference to the parent process (instead of a weak_ptr) -- having a process instance always available allows us to simplify some logic in this class (some of it was already simplified because we were asserting that the process is available, but this makes it obvious). Reviewers: krytarowski, eugene, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D35123 llvm-svn: 308282
* Rename Error -> Status.Zachary Turner2017-05-121-32/+33
| | | | | | | | | | | | | | | This renames the LLDB error class to Status, as discussed on the lldb-dev mailing list. A change of this magnitude cannot easily be done without find and replace, but that has potential to catch unwanted occurrences of common strings such as "Error". Every effort was made to find all the obvious things such as the word "Error" appearing in a string, etc, but it's possible there are still some lingering occurences left around. Hopefully nothing too serious. llvm-svn: 302872
* Move Log from Core -> Utility.Zachary Turner2017-03-031-1/+1
| | | | | | | | | 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
* Hardware breakpoints for Linux on Arm/AArch64 targetsOmair Javaid2017-02-241-0/+10
| | | | | | | | Please look at below differential link for upstream discussion. Differential revision: https://reviews.llvm.org/D29669 llvm-svn: 296119
* Make GetRegisterByName() take a StringRef.Zachary Turner2016-11-171-13/+11
| | | | | | | This one is fairly trivial and only really involves changing function signatures and a few simple call-sites. llvm-svn: 287266
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-370/+292
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Delete Host/windows/win32.hZachary Turner2016-08-091-0/+1
| | | | | | | | | | | | | | | | | | | It's always hard to remember when to include this file, and when you do include it it's hard to remember what preprocessor check it needs to be behind, and then you further have to remember whether it's windows.h or win32.h which you need to include. This patch changes the name to PosixApi.h, which is more appropriately named, and makes it independent of any preprocessor setting. There's still the issue of people not knowing when to include this, because there's not a well-defined set of things it exposes other than "whatever is missing on Windows", but at least this should make it less painful to fix when problems arise. This patch depends on LLVM revision r278170. llvm-svn: 278177
* [LLDB][MIPS] Handle false positives for MIPS hardware watchpointsJaydeep Patil2015-08-131-0/+6
| | | | | | | | | | | | | | | | SUMMARY: Last 3bits of the watchpoint address are masked by the kernel. For example, n is at 0x120010d00 and m is 0x120010d04. When a watchpoint is set at m, then watch exception is generated even when n is read/written. To handle this case, instruction at PC is emulated to find the base address of the load/store instruction. This address is then appended to the description of the stop-info packet. Client then reads this information to check whether the user has set a watchpoint on this address. Reviewers: jingham, clayborg Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits Differential Revision: http://reviews.llvm.org/D11672 llvm-svn: 244864
* [LLDB][MIPS] MIPS32 branch emulation and single-steppingJaydeep Patil2015-06-231-0/+6
| | | | | | | | | | | | | | | SUMMARY: This patch implements 1. Emulation of MIPS32 branch instructions 2. Enable single-stepping for MIPS32 instructions 3. Correction in emulation of MIPS64 branch instructions with delay slot 4. Adjust breakpoint address when breakpoint is hit in a forbidden slot of compact branch instruction Reviewers: clayborg Subscribers: mohit.bhakkad, sagar, bhushan, lldb-commits, emaste, nitesh.jain Differential Revision: http://reviews.llvm.org/D10596 llvm-svn: 240373
* This patch adds support for setting/clearing hardware watchpoints and ↵Omair Javaid2015-05-151-1/+1
| | | | | | | | breakpoints on AArch64 (Arm v8) 64-bit hardware. http://reviews.llvm.org/D9706 llvm-svn: 237419
* Fixed some compiler warnings because of bit-width mismatches.Chaoren Lin2015-05-011-3/+6
| | | | llvm-svn: 236323
* Fixed some compiler warnings because of bit-widthSean Callanan2015-05-011-3/+3
| | | | | | mismatches. llvm-svn: 236295
* Remove trap code from disassembly.Chaoren Lin2015-04-291-7/+7
| | | | | | | | | | | | | | | | | | | | Summary: NativeProcessProtocol uses ReadMemory internally for setting/checking breakpoints but also for generic memory reads (Handle_m), this change adds a ReadMemoryWithoutTrap for that purpose. Also fixes a bunch of misuses of addr_t as size/length. Test Plan: `disassemble` no longer shows the trap code. Reviewers: jingham, vharron, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9330 llvm-svn: 236132
* Report watchpoint hits during single stepping.Chaoren Lin2015-03-191-2/+11
| | | | | | | | | | | | | | | | | | Summary: Reorganized NativeProcessLinux::MonitorSIGTRAP to check for watchpoint hits on TRAP_TRACE. Added test for stepping over watchpoints. https://llvm.org/bugs/show_bug.cgi?id=22814 Reviewers: ovyalov, tberghammer, vharron, clayborg Subscribers: jingham, labath, lldb-commits Differential Revision: http://reviews.llvm.org/D8404 llvm-svn: 232784
* Move lldb-log.cpp to core/Logging.cppZachary Turner2015-03-181-2/+0
| | | | | | | | | So that we don't have to update every single #include in the entire codebase to #include this new header (which used to get included by lldb-private-log.h, we automatically #include "Logging.h" from within "Log.h". llvm-svn: 232653
* Report stopped by trace if none of the watchpoint was hitTamas Berghammer2015-03-171-0/+18
| | | | | | | | | | Some linux kernel reports a watchpoint hit after single stepping even when no watchpoint was hit. This CL looks for a watchpoint which was hit and reports a stop by trace if it haven't found any. Differential revision: http://reviews.llvm.org/D8081 llvm-svn: 232482
* Implement setting and clearing watchpoints.Chaoren Lin2015-02-031-0/+6
| | | | llvm-svn: 227930
* Moving header files from source/Host/common to proper location.Chaoren Lin2015-02-031-0/+470
llvm-svn: 227929
OpenPOWER on IntegriCloud