aboutsummaryrefslogtreecommitdiff
path: root/src/core/gdbstub/gdbstub.cpp
AgeCommit message (Collapse)Author
2020-11-27core: Eliminate remaining usages of the global system instanceLioncash
Removes all remaining usages of the global system instance. After this, migration can begin to migrate to being constructed and managed entirely by the various frontends.
2020-10-20Revert "core: Fix clang build"bunnei
2020-10-17core: Fix clang buildLioncash
Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795
2020-10-13core/CMakeLists: Make some warnings errorsLioncash
Makes our error coverage a little more consistent across the board by applying it to Linux side of things as well. This also makes it more consistent with the warning settings in other libraries in the project. This also updates httplib to 0.7.9, as there are several warning cleanups made that allow us to enable several warnings as errors.
2020-06-27General: Cleanup legacy code.Fernando Sahmkow
2020-04-21Merge pull request #3699 from FearlessTobi/port-5185bunnei
Port citra-emu/citra#5185: "gdbstub: Fix some gdbstub jankiness"
2020-04-17core: gdbstub: Updates for new VMM.bunnei
2020-04-17gdbstub: Fix some gdbstub jankinessMerryMage
1. Ensure that register information available to gdbstub is most up-to-date. 2. There's no reason to check for current_thread == thread when emitting a trap. Doing this results in random hangs whenever a step happens upon a thread switch.
2020-03-17gdbstub: small logic bug fix with defer_startGauvain "GovanifY" Roussel-Tarbouriech
2020-03-17gdbstub: Ensure gdbstub doesn't drop packets crucial to initializationGauvain "GovanifY" Roussel-Tarbouriech
2020-03-02core: Implement separate A32/A64 ARM interfaces.bunnei
2020-01-26Core: Refactor CpuCoreManager to CpuManager and Cpu to Core Manager.Fernando Sahmkow
This commit instends on better naming the new purpose of this classes.
2019-11-26core/memory: Migrate over Write{8, 16, 32, 64, Block} to the Memory classLioncash
The Write functions are used slightly less than the Read functions, which make these a bit nicer to move over. The only adjustments we really need to make here are to Dynarmic's exclusive monitor instance. We need to keep a reference to the currently active memory instance to perform exclusive read/write operations.
2019-11-26core/memory: Migrate over Read{8, 16, 32, 64, Block} to the Memory classLioncash
With all of the trivial parts of the memory interface moved over, we can get right into moving over the bits that are used. Note that this does require the use of GetInstance from the global system instance to be used within hle_ipc.cpp and the gdbstub. This is fine for the time being, as they both already rely on the global system instance in other functions. These will be removed in a change directed at both of these respectively. For now, it's sufficient, as it still accomplishes the goal of de-globalizing the memory code.
2019-11-26core/memory: Migrate over address checking functions to the new Memory classLioncash
A fairly straightforward migration. These member functions can just be mostly moved verbatim with minor changes. We already have the necessary plumbing in places that they're used. IsKernelVirtualAddress() can remain a non-member function, since it doesn't rely on class state in any form.
2019-11-12gdbstub: Resolve sign conversion errorsLioncash
2019-10-15Correct compiling errors and addapt to the new interface.Fernando Sahmkow
2019-10-06core: Remove Core::CurrentProcess()Lioncash
This only encourages the use of the global system instance (which will be phased out long-term). Instead, we use the direct system function call directly to remove the appealing but discouraged short-hand.
2019-03-15gdbstub: Fix some bugs in IsMemoryBreak() and ServeBreak. Add workaround to ↵Dimitri A
let watchpoints break into GDB. (#4651) * gdbstub: fix IsMemoryBreak() returning false while connected to client As a result, the only existing codepath for a memory watchpoint hit to break into GDB (InterpeterMainLoop, GDB_BP_CHECK, ARMul_State::RecordBreak) is finally taken, which exposes incorrect logic* in both RecordBreak and ServeBreak. * a blank BreakpointAddress structure is passed, which sets r15 (PC) to NULL * gdbstub: DynCom: default-initialize two members/vars used in conditionals * gdbstub: DynCom: don't record memory watchpoint hits via RecordBreak() For now, instead check for GDBStub::IsMemoryBreak() in InterpreterMainLoop and ServeBreak. Fixes PC being set to a stale/unhit breakpoint address (often zero) when a memory watchpoint (rwatch, watch, awatch) is handled in ServeBreak() and generates a GDB trap. Reasons for removing a call to RecordBreak() for memory watchpoints: * The``breakpoint_data`` we pass is typed Execute or None. It describes the predicted next code breakpoint hit relative to PC; * GDBStub::IsMemoryBreak() returns true if a recent Read/Write operation hit a watchpoint. It doesn't specify which in return, nor does it trace it anywhere. Thus, the only data we could give RecordBreak() is a placeholder BreakpointAddress at offset NULL and type Access. I found the idea silly, compared to simply relying on GDBStub::IsMemoryBreak(). There is currently no measure in the code that remembers the addresses (and types) of any watchpoints that were hit by an instruction, in order to send them to GDB as "extended stop information." I'm considering an implementation for this. * gdbstub: Change an ASSERT to DEBUG_ASSERT I have never seen the (Reg[15] == last_bkpt.address) assert fail in practice, even after several weeks of (locally) developping various branches around GDB. Only leave it inside Debug builds.
2019-02-06gdbstub: only let Execute breakpoints write/restore BKPT opcodes into target ↵Dimitri ALBORA
memory
2018-12-18kernel/thread: Make thread_id a 64-bit valueLioncash
The kernel uses a 64-bit value for the thread ID, so we shouldn't be using a 32-bit value.
2018-11-26gdbstub: Silence value truncation warning within FpuWrite()Lioncash
Previously this would cause an implicit truncation warning about assigning a u64 value to a u32 value without an explicit cast.
2018-11-13GDBStub improvements:Hedges
- Add FPU support - Fix access to TLS Fix clang-format.
2018-10-15core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrsLioncash
2018-10-04kernel/thread: Make all instance variables privateLioncash
Many of the member variables of the thread class aren't even used outside of the class itself, so there's no need to make those variables public. This change follows in the steps of the previous changes that made other kernel types' members private. The main motivation behind this is that the Thread class will likely change in the future as emulation becomes more accurate, and letting random bits of the emulator access data members of the Thread class directly makes it a pain to shuffle around and/or modify internals. Having all data members public like this also makes it difficult to reason about certain bits of behavior without first verifying what parts of the core actually use them. Everything being public also generally follows the tendency for changes to be introduced in completely different translation units that would otherwise be better introduced as an addition to the Thread class' public interface.
2018-09-30kernel/process: Make data member variables privateLioncash
Makes the public interface consistent in terms of how accesses are done on a process object. It also makes it slightly nicer to reason about the logic of the process class, as we don't want to expose everything to external code.
2018-09-30arm_interface: Add missing fpsr/tpidr members to the ThreadContext structLioncash
Internally within the kernel, it also includes a member variable for the floating-point status register, and TPIDR, so we should do the same here to match it. While we're at it, also fix up the size of the struct and add a static assertion to ensure it always stays the correct size.
2018-09-24memory: Dehardcode the use of fixed memory range constantsLioncash
The locations of these can actually vary depending on the address space layout, so we shouldn't be using these when determining where to map memory or be using them as offsets for calculations. This keeps all the memory ranges flexible and malleable based off of the virtual memory manager instance state.
2018-09-20Correct endianness of BKPTJarek Syrylak
2018-09-18arm_interface: Remove ARM11-isms from the CPU interfaceLioncash
This modifies the CPU interface to more accurately match an AArch64-supporting CPU as opposed to an ARM11 one. Two of the methods don't even make sense to keep around for this interface, as Adv Simd is used, rather than the VFP in the primary execution state. This is essentially a modernization change that should have occurred from the get-go.
2018-09-15Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi
2018-08-06GDBStub works with both Unicorn and Dynarmic now (#941)Hedges
* GDBStub works with both Unicorn and Dynarmic now * Tidy up
2018-08-05gdbstub: Use type alias for breakpoint mapsLioncash
Rather than having to type out the full std::map type signature, we can just use a straightforward alias. While we're at it, rename GetBreakpointList to GetBreakpointMap, which makes the name more accurate. We can also get rid of unnecessary u64 static_casts, since VAddr is an alias for a u64.
2018-08-05gdbstub: Move all file-static variables into the GDBStub namespaceLioncash
Keeps everything under the same namespace. While we're at it, enclose them all within an inner anonymous namespace.
2018-08-05gdbstub: Replace PAddr alias with VAddrLioncash
In all cases, a virtual address is being passed in, not a physical one.
2018-08-01kernel: Move object class to its own source filesLioncash
General moving to keep kernel object types separate from the direct kernel code. Also essentially a preliminary cleanup before eliminating global kernel state in the kernel code.
2018-07-19gdbstub: Get rid of a few signed/unsigned comparisonsLioncash
Ensures both operands in comparisons are the same signedness.
2018-07-12More improvements to GDBStub (#653)Hedges
* More improvements to GDBStub - Debugging of threads should work correctly with source and assembly level stepping and modifying registers and memory, meaning threads and callstacks are fully clickable in VS. - List of modules is available to the client, with assumption that .nro and .nso are backed up by an .elf with symbols, while deconstructed ROMs keep N names. - Initial support for floating point registers. * Tidy up as requested in PR feedback * Tidy up as requested in PR feedback
2018-07-02Update clang formatJames Rowe
2018-07-02Rename logging macro back to LOG_*James Rowe
2018-06-06GDB Stub Improvements (#508)Hedges
* GDB Stub should work now. * Applied clang-format. * Replaced htonll with swap64. * Tidy up.
2018-05-10core: Implement multicore support.bunnei
2018-04-26core/gdbstub: Move logging macros to new fmt-compatible onesLioncash
2018-03-19Clean Warnings (?)N00byKing
2018-02-14gdbstub: Silence formatting specifier warningsLioncash
2018-01-21gdbstub: Update registers and sizes for aarch64Rozlette
This gets gdbstub working at least to the point where clients can communicate with it. What works: - Reading/writing GPRegs - Reading/writing memory - Interrupting the emulated program and continuing What does NOT work: - Breakpoints. Sizes have been updated to u64, but support will need to be added in the interpreter for them to work. - VRegs. Mostly because my gdb was having issues with 128-bit regs for some reason. However, the current u128 representation is a bit awkward to use and should probably be updated first.
2018-01-19Fixes some cast warnings, partial port of citra #3064 (#106)River City Ransomware
* Fixes some cast warnings, partially fixes citra #3064 * Converted casts to uint32_t to u32 * Ran clang-format
2018-01-17Fix gdbstub typo, fixes Citra #3318River City Ransomware
Core::System().GetInstance().IsPoweredOn() -> Core::System::GetInstance().IsPoweredOn()
2018-01-02arm: Remove SkyEye/Dyncom code that is ARMv6-only.bunnei
2017-10-04Memory: Remove all GetPointer usages from the GDB stub.Subv