Commit Graph

267 Commits

Author SHA1 Message Date
Ziemas e19c9a967d MipsStackWalk: clang-format 2023-10-26 19:25:13 +01:00
Ziemas 83c18d0cb6 DebugInterface: Fix r3000 isValidAddress 2023-10-26 19:25:13 +01:00
Ty Lamontagne 4f825641ce Debugger: Copy as CSV. Breakpoint import from CSV 2023-10-12 12:46:12 +10:00
Stenzek bf2cdc3c9b DebugTools: Replace sprintf() with snprintf() 2023-10-02 17:37:38 +10:00
Ty Lamontagne fdb0312326 Dis5900: Mask and extend the pmfhl & pmthl LUT
Fixes an OOB access when disassembling an invalid opcode (71756972h)
2023-08-11 00:09:25 +01:00
Ziemas c5f47a8db3 mipsanalyst: sign extend 32 bit regs 2023-07-08 18:51:36 +01:00
Stenzek 512d24cea6 Misc: More build system cleanups
Set UTF-8 source file format globally.
Set permissive/compliance mode globally.
Get rid of include of base 3rdparty directory, be explicit.
Get rid of duplicated properties.
Get rid of leftover plugin property files.
2023-05-16 12:58:19 +01:00
Ty Lamontagne d76a0d7416 Debugger: Implement BC0XY branches & their condition evaluation 2023-04-25 17:28:31 +01:00
Ziemas bca49184e7
Debugger: Fix missing return path. () 2023-02-09 19:48:54 +00:00
Ziemas 9420615317 Implement thread listing for IOP
Abstracts away threads behind a common interface for both EE and IOP
2023-02-09 15:49:56 +00:00
Stenzek d12fa690c0 R5900: Remove exceptions 2023-01-26 11:11:36 +00:00
Ty Lamontagne a0000a8547 Debugger: Implement boot and debug
Creates a breakpoint automatically on the ELF entry point
2023-01-15 17:05:35 +00:00
Ty Lamontagne 577e15a949 Debugger Expressions: Add 'target', 'load', and 'store' reference
target -> The evaluated target of the load or the store, 0 if the opcode is not a memory access
load -> The evaluated target of a load, is 0 if the opcode is not loading
store -> The evaluated target of a store, is 0 if the opcode is not storing

Fixes the disassembly widget mouse click handler
Fixes the breakpoint dialog not setting the breakpoint address or condition cpu (oops)
2023-01-14 01:58:04 +00:00
Ty Lamontagne 37540d1c68 Debugger Breakpoints: (Refactor) Use some reflection and item models 2023-01-10 13:57:06 +01:00
Stenzek f0a7c41b81 Misc: Remove last remnants of DISABLE_RECORDING 2022-12-28 11:02:53 +00:00
Stenzek 96a1c77577 Core: Remove PCSX2_CORE define and leftovers from wx 2022-12-24 08:42:23 +00:00
Ty Lamontagne 2f0b244f48 Debugger: Initial debugger implementation 2022-12-24 07:21:49 +00:00
Ty Lamontagne 78c9b7f33e Debugger Core: Initial QT core work
Revert 3ce242886b (Disabled force symbol loading) until solution is found

If this isn't caught when the game is loaded, the symbols will not be properly loaded while the game is running.

DisassemblyManager: Don't spin continuously if the guest CPU is dead
2022-12-24 07:21:49 +00:00
Connor McLaughlin 00bcb4cf02 System: Revamp memory allocation
Guest memory is now mapped into a shared memory/file mapping, for use
with fastmem.

64-bit and 128-bit arguments are passed by register/value instead of by
reference/address.

LDL/LDR/SDL/SDR now use 64-bit GPRs instead of SSE.
2022-10-14 22:24:42 +01:00
TellowKrinkle 738c8cb630 Core: Remove trailing whitespace from all files 2022-09-16 00:52:28 -05:00
lightningterror 6eb7f5f962 DebutTools: Fix variable initializations.
Codacy Warning: Variable 'variable' is assigned in constructor body. Consider performing initialization in initialization list.
2022-08-26 02:16:00 +02:00
Connor McLaughlin ea051c6d5f Everything: Get rid of wx entirely from the Qt build 2022-05-22 13:58:56 +01:00
Connor McLaughlin 893b3c629d Everything: Remove a **lot** of wx, and px nonsense
- common has no wx left except for Path.
 - pcsx2core only has it in a few places (memory cards and path related
   stuff).
2022-05-22 13:58:56 +01:00
Connor McLaughlin d535331b4b Misc: Remove __fastcall, __fc, __concall and friends
These have no meaning in x64 (apart from throwing compiler warnings),
and we don't do 32-bit anymore. Also saves needing to include
`Pcsx2Defs.h` in files which don't otherwise need it.
2022-05-12 14:58:03 +01:00
Connor McLaughlin 756cd1ee47 System: Move old SysThread junk to gui 2022-05-08 05:40:59 +01:00
Connor McLaughlin 41e8a2a7d1 MTGS: Purge pxThread 2022-05-07 15:43:03 +01:00
arcum42@gmail.com 233195b020 Remove macros that 'might be needed again in the future'. 2022-05-07 05:26:46 +01:00
Ty Lamontagne a632f3c5cb Core: Lighten IOP breakpoint load
standardizeBreakpintAddress calls on the IOP just return the address unmodified. Considering this is called at least once every load / store instruction when there is an IOP OR EE memcheck enabled, it's pretty hot.
2022-02-04 16:52:27 +00:00
Tokman5 e64e2f2c4e Debugger: add register name pattern 2022-02-04 15:34:46 +00:00
Connor McLaughlin 252562db90 Misc: #ifdef out last bits of wx-dependent code 2021-12-28 05:22:45 +00:00
Ty Lamontagne a396b50610 Debugger: Allow access to all of 0xBXXXXXXX 2021-11-14 20:19:33 +00:00
TellowKrinkle f7476dfb63 Core: Replace alignment macros with alignas 2021-11-14 13:52:20 -06:00
TellowKrinkle cbcd9b5004 wx: Remove wxString implicit constructor from std::string
On windows, it uses the current system's character encoding instead of utf-8, which breaks a lot of things.  We should avoid it.
2021-11-13 18:44:26 -06:00
Ziemas 3f6ac2fa68 Debugger: Separate EE and IOP symbol maps
Previously they shared a single map which dosen't make sense.
2021-10-17 04:08:35 +01:00
Ziemas f873e3b630 Debugger: Prefer override over virtual 2021-10-17 04:08:35 +01:00
Connor McLaughlin 6b2a865e57 Remove references to global CoreThread (use accessor) 2021-10-01 23:46:52 -04:00
lightningterror b0932825a9 Debugger: Try to fix Wreorder warnings. 2021-09-26 20:42:12 +02:00
Silent 4c941f81ec Delegate systems teardown to EE Core when pausing
Fixes issues caused by Cleanup/Init on the Main Thread
instead of the EE Core thread. Now systems are only set up
and torn down on one thread.
2021-09-25 14:32:10 -04:00
refractionpcsx2 ee9672858c VU Int: Remove rogue value from debug logging 2021-09-19 16:30:08 +01:00
Connor McLaughlin 65aa811344 DebugTools: Add missing Config.h include 2021-09-17 22:03:00 -04:00
Connor McLaughlin e2992cbc02 Remove gui/ directory from target-wide includes 2021-09-17 22:03:00 -04:00
kojin 8fdaaa2eab common: reorganize 2021-09-04 18:28:07 -04:00
Ty Lamontagne 87ee413141 Debugger: codacy warnings 2021-08-07 05:54:13 +01:00
Ty Lamontagne bb3fb35c7e clang-format: DebugInterface.cpp CtrlRegisterList.cpp CtrlRegisterList.h 2021-08-07 05:54:13 +01:00
Ty Lamontagne 8f171c70f5 Debugger: Add option to display VU0F registers as floats 2021-08-07 05:54:13 +01:00
Jannik Vogel 21c13a850c Misc:Debugger: Fix vmulai and vmaddai disassembly 2021-08-04 00:49:14 +01:00
Timothy O'Barr 85d35311d0
UI: Added PGIF log source () 2021-07-29 17:56:17 +01:00
ty 54590a843a Misc: Pattern match to find the bios thread address 2021-07-05 03:17:10 +02:00
Gauvain 'GovanifY' Roussel-Tarbouriech fa9b30fa9e pcsx2: remove relative imports
gosh that was a pain, please don't make me do that again
2021-07-03 18:16:11 -04:00
ty e36199c499 Misc:Debugger: Support write-only GS priv reads 2021-04-01 16:32:47 +02:00
ty e18ee42afc Misc: Fix various DebugTools Codacy complaints 2021-03-16 17:38:54 +00:00
Maxim Nikitin 7dbf01b024
Implements IOP breakpoints ()
IOP: Implement IOP Breakpoints
2021-01-08 23:34:08 +00:00
Tyler Wilding 9fa484dbab GameDB/MSVC: renamed _Target_ to _InstrucTarget_ to avoid collisions 2020-12-16 09:31:58 +00:00
arcum42 9d4337b7eb
[USB+] Clean up Warnings ()
* Suppress hardening warning spam for the moment. Get rid of a multi-line comment warning.

* Resolve a bunch of warnings about unused variables, unused labels, and sign mismatches.

* Deal with various possibly unused variables.

* Rearrange member variables to match initialization order.

* Move [[maybe_unused]] to a separate line in one spot to make it easier to read.
2020-11-15 04:37:58 -08:00
tellowkrinkle f9771c38a6
macOS fixes ()
* macOS compile

* Fix memprotect error on macOS

* Fix semaphore wait + thread cancel on macOS

* Fix timedlock timeout calculation

* spu2-x macOS

* onepad macOS support

* Add MacOS game controller db

* Disable onepad_legacy on macOS

* Fix spu2-x configuration crashes

* Make recompiler work on 32-bit macOS

* Use dylib extension for plugins on macOS

* Make app bundle on macOS

* Use git info for Info.plist version
2020-05-23 23:19:47 -07:00
refractionpcsx2 939e576df9 Separate debug pausing from savestates and recording frame advance 2020-05-02 04:29:30 +01:00
Jonathan Li c87b8c7f49 pcsx2|utilities: Remove ambiguous wxString-related overloads
Avoid some function overloads that can accept char*, wxChar* and
wxString as a parameter. wxString can be constructed with either of
those parameters, so the function overloads may actually result in
ambiguity errors. Keep the wxString parameter versions and remove the
rest.

Fixes some compile errors on FreeBSD.
2019-10-07 01:39:32 +01:00
Tyler Wilding 506ea4c4d2 recording: various formatting and review corrections
Squashed commit:

[7955b42e3] recording: Throw errors on fread/fwrite errors.

[5a2160f9e] recording: Remove function implementation from header files

[f2937ab5f] recording: Fixed UndoCount metadata bug and will gracefully fail if savestate is missing

[d7f4d43e5] recording: Refactored code-style to be consistent

[0f77fbb71] recording: Refactor to use switch statements

[28d7945f6] recording: Resolve CMake warnings and use tagged github links for cross-linking to LilyPad

[7c01c6cb4] recording: corrected disparity between comment and code

[17a8bd8d6] recording: Remove all usages of #define

[3830f5a82] recording: Refactor enums and general cleanup

[569ef7d67] recording: Completely disable new console log sources when recording is disabled
2019-04-21 00:45:44 +02:00
Tyler Wilding cb7425c59f recording: removed C++ reserved pattern usages, removed japanese comments 2019-04-21 00:45:44 +02:00
Tyler Wilding e3333a9b8c recording: all modifications to pcsx2/ source 2019-04-21 00:45:44 +02:00
PSISP 9e7b2ed153 Debugger: Make EE kernel region accessible to debugger. ()
Currently, none of the EE kernel is viewable from the debugger, which poses issues when debugging code that makes use of syscalls. This PR should allow the memory region 0x80000000 - 0x800FFFFF to have readable disassembly.
2018-11-08 23:17:30 +01:00
Jonathan Li a977f1e6c1 pcsx2|utilities; Revert ambiguous wxString related commits
This reverts
93d5b52df3
f3e78b8267
55155ca7f1.

Unfortunately wxString stuff is a PITA to deal with. Breaks FreeBSD
compile, but there are probably more issues that just haven't been
reported yet...
2018-09-04 21:57:27 +01:00
Jonathan Li 93d5b52df3 pcsx2|utilities: Remove ambiguous wxString-related overloads
Avoid some function overloads that can accept char*, wxChar* and
wxString as a parameter. wxString can be constructed with either of
those parameters, so the function overloads may actually result in
ambiguity errors. Keep the wxString parameter versions and remove the
rest.

Fixes some compile errors on FreeBSD.
2018-09-03 01:56:35 +01:00
Souzooka 7963f418c1 Add System Out as a logging source. ()
* Enable logging from new source, PS2 system output

* Enable printf formatting with (up to only 7 currently)

* Fix fallthrough bug in SYSCALL switch/case

* Remove unnecessary memread32 call in sysPrintOut case
2018-08-27 13:56:48 +02:00
Souzooka d00e0ed605 Debugger: Display ACC register. ()
Displays/allows ACC VU0f register to be set.
2018-08-11 16:14:08 +02:00
Jonathan Li c10d6c3ed1 pcsx2: Add override to SysTraceLog functions declarations/definitions
Makes it clearer what is being overridden. Also avoids a
-Winconsistent-missing-override warning on clang.
2018-08-07 00:15:10 +01:00
Souzooka 4e429b27be Debugger: Display/set correct VU values () 2018-07-30 09:20:37 +01:00
Jonathan Li 1b5f2639a0 pcsx2:windows: Fix path issues
Fixes some issues with opening files if the path contains characters not
present in the current codepage.
2018-07-23 00:51:02 +01:00
Jonathan Li 1d7cef08a7 pcsx2: Fix potential return of uninitialised value 2018-04-26 01:15:44 +01:00
Jonathan Li 8dfeeb354f pcsx2: Fix Trace Logging enable/disable behaviour
This disables SIF logging if the master trace logging switch has been
disabled.
2018-02-28 01:19:12 +00:00
Russ K 854246846d Fix mouse click focus in debugger near functions ending in a branch. ()
This code updates the DisassemblyFunction objects to only include Delay Slots when they are within the bounds of the function.
2018-01-06 11:05:42 +01:00
Russ K 74282b46ff Corrected MipsOpscodes table for unconditional branch. ()
The assembler was previously assembling instruction "b i" as an alias to "j I".
This caused unexpected behavior when attempting to assemble an
unconditional branch. The previous behavior would cause
position-independent code to fail due to the distinction between
the absolute address of a jump vs. the offset of a branch.
2018-01-04 10:01:48 +01:00
Kingcom 92aa270062 Align functions to up to 16 bytes in the function scanner 2017-04-19 08:34:03 +02:00
Gregory Hainaut 35ed991abe pcsx2: set the size of the vector in the constructor 2017-02-03 21:56:24 +01:00
Gregory Hainaut 6d7b1f9dbd common: move ssappendf in DisR59000asm.cpp
Legacy function to print EE opcode. It doesn't worth an extra file.
2017-02-01 18:24:51 +01:00
Jonathan Li 7ad38057b5 symbolmap: Use C++11 recursive mutex
Newer wxWidgets versions call SetThreadUILanguage() on Windows, which
somehow causes our recursive mutex implementation to take ~1ms when
recursive locking occurs. So when a game boots up and the debugger is
loading the symbol map which can easily have 15000+ symbols, the GUI
locks up for 15+ seconds.

Switching to C++11 recursive mutexes seems to work around the issue. It
should be safe here since there's no direct interaction with the GUI.

Note: There is still a 1-2 second GUI lockup when booting a game on
Windows (it has existed for quite a while, and is more noticeable with
fast boot). It doesn't seem to affect Linux (or maybe it's harder to
detect).
2016-09-30 00:55:07 +01:00
Gregory Hainaut ac1b3845b2 pcsx2:log: add MDEC_LOG trace capability 2016-09-18 15:35:59 +02:00
Gregory Hainaut 4796803c33 pcsx2: Remove == true/false for boolean logic ()
As discussed in 

Clang Tidy reports goes from 156 to 9.

Remain some macro in spu2x + a deadcode line
2016-09-10 20:08:14 +02:00
Gregory Hainaut 4ebe739b44 pcsx2: remove various unused variable
Warning can be reenabled on GCC

A warning isn't fixed as potentially the code is wrong
../pcsx2/gui/MemoryCardFolder.cpp: In member function ‘void FolderMemoryCard::FlushFileEntries(u32, u32, const wxString&, MemoryCardFileMetadataReference*)’:
../pcsx2/gui/MemoryCardFolder.cpp:1027:10: warning: unused variable ‘filenameCleaned’ [-Wunused-variable]
     bool filenameCleaned = FileAccessHelper::CleanMemcardFilename( cleanName );
2016-09-10 00:09:05 +02:00
Gregory Hainaut 1a8825b374 pcsx2|common|gsdx: use empty() instead of .size() ==/!= 0 check
Enhance readability reported by clang tidy
2016-08-21 17:20:13 +02:00
Gregory Hainaut 15a4d1f0a9 pcsx2: fix gcc warning
MIPSAnalyst.cpp:124:9: warning: ‘takeBranch’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    else if (sure && !takeBranch)

False positive as sure will be false but safer this way
2016-08-17 21:23:06 +02:00
Gregory Hainaut 55bc7a678a pcsx2: ICC warning: type qualifier on return type is meaningless 2016-07-28 10:36:58 +02:00
Gregory Hainaut a735e2b58f Merge pull request from mogaika/debug_window_improve
Debugger features
2016-07-07 19:59:33 +02:00
Vladimir Jigulin 7e91eb6616 debugger: some user-friendly improves in ui
Grouping bytes in debugger memory window, following pointers and history
Goto in register view
Printing strings in pointer registers
Memory view can be resized correctly by ctrl+wheel
Improvement in function 5900DebugInterface::isValidAddress
2016-07-03 22:01:09 +03:00
NZJenkins 6bc02cbb45 GetBreakPointCondition handle temp breakpoints
Fixes 
temp bp were not previously handled
2016-05-30 16:16:32 +12:00
Jonathan Li d89043d8ac pcsx2: Remove wx2.8 code and uses of wxMAJOR_VERSION
Technically wxMAJOR_VERSION wasn't the right thing to use, but it was
good enough.
2016-04-29 00:09:47 +01:00
Gregory Hainaut 5736b5e9eb debugger: properly init DisassemblyLineInfo
Avoid conditinal check on uninitialized value (reported by Valgrind)
2016-04-07 09:36:22 +02:00
Gregory Hainaut 0fb249284f debugger: initialized member
CID 147003
CID 147004
2016-03-30 19:56:19 +02:00
ramapcsx2 32182fe126 always fflush ee/iop logs. fixes the test suite timing out on windows. 2016-02-13 12:14:40 +01:00
BoopFtang 83a877c3dc Fixes
In the case of a disabled breakpoint at the address, false would be
returned without checking for temp breakpoint
2016-02-10 15:54:56 +13:00
Jonathan Li 04a8efd8c3 pcsx2|common: Use _WIN32 for Windows preprocessor macro
It's predefined, unlike WIN32 and _WINDOWS (and other variants), which
are defined in the property sheets.
2016-01-27 22:41:45 +00:00
Gregory Hainaut bfd1bcec69 iop: improve debug
Add a nop between instruction
Dump mips instruction
Add pretty print support

Note: it would be nicer to plug pretty print in the system command directly
2016-01-27 10:27:34 +01:00
Gregory Hainaut f5d71352ca pcsx2: avoid flushing issue with the test suite
Linux only as I don't know if windows suffers of the same issue.
2016-01-26 09:18:15 +01:00
Juha Laukkanen 4fa8834de4 Darwin/OSX ifdef __APPLE__ or __WXMAC__ cases.
OSX comment about __WXMAC__ usage
2015-12-02 05:00:41 +02:00
Gregory Hainaut f2f28d1794 pcsx2: add missing case in switch 2015-11-12 12:11:44 +01:00
Gregory Hainaut 8fb6f0f328 debug: properly redo VU dissassembler function
I misses some calls in DisVUops. Use a macro to directly output the string
in the correct buffer position.
2015-11-07 13:55:47 +01:00
Gregory Hainaut e4e68a6179 debug: 'ostr' is used as parameter and destination in s[n]printf(). 2015-11-06 23:01:58 +01:00
Akash b2ee732321 pcsx2-debug: Initialize all class members
CID 147005 ( of 1): Uninitialized pointer field (UNINIT_CTOR)2. uninit_member: Non-static class member PrePrefix is not initialized in this constructor nor in any functions that it calls.
2015-10-25 10:11:18 +05:30
Akash 1512b3ba6c pcsx2-debug: Initialize all class members
CID 146995 ( of 1): Uninitialized pointer field (UNINIT_CTOR)member_not_init_in_gen_ctor: The compiler-generated constructor for this class does not initialize cpu
2015-10-25 10:11:17 +05:30
Gregory Hainaut 281c5e4c66 Properly swap the argument of the good option
AKA: redo commit d7afd7aae0 with the eye open...
2015-10-21 20:41:40 +02:00