Commit Graph

81 Commits

Author SHA1 Message Date
88ea66053e Miscallenious fixes to gl backend and qt frontend (#6834)
* renderer_gl: Make rasterizer normal class member

* It doesn't need to be heap allocated anymore

* gl_rasterizer: Remove default_texture

* It's unused

* gl_rasterizer: General cleanup

* gl_rasterizer: Lower case lambdas

* Match style with review comments from vulkan backend

* rasterizer_cache: Prevent memory leak

* Since the switch from shared_ptr these surfaces were no longer being destroyed properly. Use our garbage collector for that purpose to destroy it safely for both backends

* rasterizer_cache: Make temp copy of old surface

* The custom surface would override the memory region of the old region resulting in garbage data, this ensures the custom surface is constructed correctly

* citra_qt: Manually create dialog tabs

* Allows for custom constructors which is very useful. While at it, global state is now eliminated from configuration

* citra_qt: Eliminate global system usage

* core: Remove global system usage in memory and HIO

* citra_qt: Use qOverload

* tests: Run clang format

* gl_texture_runtime: Fix surface scaling
2023-08-02 01:40:39 +03:00
cf9bb90ae3 code: Use std::span where appropriate (#6658)
* code: Use std::span when possible

* code: Prefix memcpy and memcmp with std::
2023-07-07 01:52:40 +03:00
34de77d429 Various miscelaneous changes (#6496) 2023-05-03 17:24:10 +02:00
696c0904f8 Update some c-style casts -> reinterpret_cast 2023-04-04 13:21:25 -04:00
6e45de760e Cleanup new code, add docs and error handling 2023-04-04 13:13:24 -04:00
0d4c93d1c2 Undo some changes exposing unused functions 2023-04-04 12:20:41 -04:00
351730d585 Fix infinite hang if GDB client kills gdbstub 2023-03-31 14:06:43 -04:00
83138e0c63 Fix some build + impl errors with HIO
After rebase there were some API changes, also fix continuation logic in
the main gdbstub.
2023-03-31 14:05:57 -04:00
f92f494cab Stop execution when performing HIO request
Since the HIO request is basically treated like a syscall, we need to
stop emulation while waiting for the GDB client to reply with the
result. This ensures any memory queries etc. that GDB makes to fulfill
the HIO request are accessing memory as it was at the time of the
request, instead of afterwards.
2023-03-29 09:09:32 -04:00
874bfebaf9 Add some notes + use stringstream to build packet 2023-03-29 09:09:32 -04:00
7de1bf3746 Properly parse incoming hio packet
This also does kind of a hacky way of sending HIO requests, since we
don't have a direct way of signaling a request should be sent like the
Rosalina implementation.

To improve this, it could probably do some kind of signal sending which
the main run loop handles instead of GDBStub::HandlePacket();
2023-03-29 09:09:32 -04:00
6f23ee43ae Initial port of luma3ds' gdb_hio to Citra 2023-03-29 09:09:32 -04:00
bb05d8c12a src/CMakeLists: Enforce multiple warnings on MSVC (#5692) 2022-11-09 23:14:28 +01:00
1ddea27ac8 code: Cleanup and warning fixes from the Vulkan PR (#6163)
Co-authored-by: emufan4568 <geoster3d@gmail.com>
Co-authored-by: Kyle Kienapfel <Docteh@users.noreply.github.com>
2022-11-04 23:32:57 +01:00
cbd5d1c15c Upgrade codebase to C++ 20 + fix warnings + update submodules (#6115) 2022-09-21 18:36:12 +02:00
da908a9ed1 core: Remove unnecessary enum casts in log calls
Follows the video core PR. fmt doesn't require casts for enum classes
anymore, so we can remove quite a few casts.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2020-12-29 06:39:21 +01:00
d17ab5cd91 gdbstub: Fix some gdbstub jankiness
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-04-06 21:24:54 +01:00
8fedd5c240 gdbstub: small logic bug fix with defer_start 2020-02-24 14:30:24 +01:00
d8bb37fc2f gdbstub: Ensure gdbstub doesn't drop packets crucial to initialization 2020-02-23 21:37:40 +01:00
Ben
55ec7031cc Core timing 2.0 (#4913)
* Core::Timing: Add multiple timer, one for each core

* revert clang-format; work on tests for CoreTiming

* Kernel:: Add support for multiple cores, asserts in HandleSyncRequest because Thread->status == WaitIPC

* Add some TRACE_LOGs

* fix tests

* make some adjustments to qt-debugger, cheats and gdbstub(probably still broken)

* Make ARM_Interface::id private, rework ARM_Interface ctor

* ReRename TimingManager to Timing for smaler diff

* addressed review comments
2020-02-21 19:31:32 +01:00
acaca4188e gdbstub: Fix some bugs in IsMemoryBreak() and ServeBreak. Add workaround to 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-03-08 00:09:06 -05:00
d388fe58f7 gdbstub: only let Execute breakpoints write/restore BKPT opcodes into target memory 2019-01-26 22:08:39 +01:00
c6b3186475 Memory: IsValidVirtualAddress can be global 2018-12-05 20:21:14 -05:00
2582d64fb3 Memory: move block operations into class 2018-12-05 20:21:14 -05:00
405218c3a7 Memory: move IsValidVirtualAddress into class 2018-12-05 20:21:14 -05:00
4e99641a3b Memory: remove WriteBlock with current process 2018-11-19 11:16:55 -05:00
8871f5a4ac Memory: remove ReadBlock with current process 2018-11-19 11:16:55 -05:00
7308b8d294 Memory: remove IsValidVirtualAddress with current process 2018-11-19 11:16:55 -05:00
20ae37ba4f kernel/Thread: move thread list into the manager 2018-10-26 16:07:45 -04:00
7d8f115185 Prefix all size_t with std::
done automatically by executing regex replace `([^:0-9a-zA-Z_])size_t([^0-9a-zA-Z_])` -> `$1std::size_t$2`
2018-09-06 16:03:28 -04:00
cf8b1726df Address review comments 2018-09-06 00:00:21 +02:00
3284bef360 string_util: Remove StringFromFormat() and related functions
Given we utilize fmt, we don't need to provide our own functions for formatting anymore
2018-09-06 00:00:21 +02:00
91559bfdfe gdbstub: Use type alias for breakpoint maps
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-25 15:34:21 +02:00
80f1ffd8dc Remove newline 2018-08-25 15:27:47 +02:00
8a109333b7 gdbstub: Move all file-static variables into the GDBStub namespace
Keeps everything under the same namespace. While we're at it, enclose
them all within an inner anonymous namespace
2018-08-25 15:27:46 +02:00
db8ec37066 gdbstub: Replace PAddr alias with VAddr
In all cases, a virtual address is being passed in, not a physical one.
2018-08-25 15:25:12 +02:00
039fb95f80 More fixes as per PR feedback. 2018-08-16 19:44:31 +01:00
a6ecb3c913 Fixed as per PR feedback. 2018-08-16 16:24:16 +01:00
bd658a8801 GDB Modernization:
- Can be used in either DynCom or Dynarmic mode
- Added support for threads
- Proper support for FPU registers
- Fix for NibbleToHex conversion that used to produce false error codes
- Fix for clang-format failing under Windows
2018-08-16 10:40:52 +01:00
5a47cbed17 no need to cast to u32 according to @wwylele comment 2018-07-30 22:40:56 +08:00
b4cdbf3ee8 gdbstub: Get rid of a few signed/unsigned comparisons
Ensures both operands in comparisons are the same signedness.
2018-07-30 22:40:43 +08:00
0eab948728 reformat all files with clang-format 2018-06-29 16:56:12 +03:00
7c5a76e58b log: replace all NGLOG with LOG 2018-06-29 14:18:07 +03:00
10f0fbc0e5 core/gdbstub: Migrate logging macros
Change to use the new logging macros
2018-04-18 21:53:26 +08:00
f61141e86a Update the entire application to use the new clang format style 2018-03-09 10:54:43 -07:00
19814d68c1 gdbstub: Correct typo
Constructing and destructing a Core::System instance for the
GetInstance() call isn't the smartest thing to do.
2017-12-20 18:47:06 +00:00
499508389c core: clear format warnings 2017-11-01 12:35:32 +02:00
7772fc0731 Memory: Remove all GetPointer usages from the GDB stub. 2017-10-04 11:33:32 -05:00
a13ab958cb Fixed type conversion ambiguity 2017-09-30 09:34:35 +01:00
0cb52ee74a Doxygen: Amend minor issues (#2593)
Corrects a few issues with regards to Doxygen documentation, for example:

- Incorrect parameter referencing.
- Missing @param tags.
- Typos in @param tags.

and a few minor other issues.
2017-02-26 17:58:51 -08:00