Commit Graph

61 Commits

Author SHA1 Message Date
Hedges
8c4754c5df GDBStub improvements:
- Add FPU support
- Fix access to TLS
Fix clang-format.
2018-11-13 15:44:20 +00:00
Lioncash
1e69ec7e8d core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrs 2018-10-15 14:15:56 -04:00
Lioncash
66f41814dc kernel/thread: Make all instance variables private
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-10-04 00:14:15 -04:00
Lioncash
7bebd9fcc5 kernel/process: Make data member variables private
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-30 02:30:01 -04:00
Lioncash
7e5a632ab3 arm_interface: Add missing fpsr/tpidr members to the ThreadContext struct
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-30 02:29:57 -04:00
Lioncash
b400e8b371 memory: Dehardcode the use of fixed memory range constants
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-24 22:16:03 -04:00
Jarek Syrylak
688c593953 Correct endianness of BKPT 2018-09-20 22:03:57 +01:00
Lioncash
e64651fb96 arm_interface: Remove ARM11-isms from the CPU interface
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-18 03:20:04 -04:00
fearlessTobi
ac0723e7be Port #4182 from Citra: "Prefix all size_t with std::" 2018-09-15 15:21:06 +02:00
Hedges
87a9960e0e GDBStub works with both Unicorn and Dynarmic now (#941)
* GDBStub works with both Unicorn and Dynarmic now

* Tidy up
2018-08-06 22:01:24 -04:00
Lioncash
fba11c0c2f 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-05 16:41:22 -04:00
Lioncash
6e056faa5f 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-05 16:41:18 -04:00
Lioncash
6ffd83480d gdbstub: Replace PAddr alias with VAddr
In all cases, a virtual address is being passed in, not a physical one.
2018-08-05 15:56:01 -04:00
Lioncash
c02c3c1dc1 kernel: Move object class to its own source files
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-08-01 23:34:42 -04:00
Lioncash
d921c38d52 gdbstub: Get rid of a few signed/unsigned comparisons
Ensures both operands in comparisons are the same signedness.
2018-07-19 15:27:01 -04:00
Hedges
0825d580b9 More improvements to GDBStub (#653)
* 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-12 20:22:59 -07:00
James Rowe
489e98954c Update clang format 2018-07-02 21:45:47 -04:00
James Rowe
847a518200 Rename logging macro back to LOG_* 2018-07-02 21:45:47 -04:00
Hedges
efe09bd4b2 GDB Stub Improvements (#508)
* GDB Stub should work now.

* Applied clang-format.

* Replaced htonll with swap64.

* Tidy up.
2018-06-06 00:20:47 -04:00
bunnei
c5e0d82b9c core: Implement multicore support. 2018-05-10 19:34:46 -04:00
Lioncash
5cc28da306 core/gdbstub: Move logging macros to new fmt-compatible ones 2018-04-26 12:04:50 -04:00
N00byKing
10448f9fb4 Clean Warnings (?) 2018-03-19 17:07:08 +01:00
Lioncash
4f3f2d5a21 gdbstub: Silence formatting specifier warnings 2018-02-14 01:50:01 -05:00
Rozlette
0dd3ee0101 gdbstub: Update registers and sizes for aarch64
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-21 11:12:49 -06:00
River City Ransomware
1370c2e582 Fixes some cast warnings, partial port of citra #3064 (#106)
* Fixes some cast warnings, partially fixes citra #3064

* Converted casts to uint32_t to u32

* Ran clang-format
2018-01-19 18:01:41 -05:00
River City Ransomware
64f6e5a47e Fix gdbstub typo, fixes Citra #3318
Core::System().GetInstance().IsPoweredOn() -> Core::System::GetInstance().IsPoweredOn()
2018-01-17 09:25:25 -05:00
bunnei
e9072e7381 arm: Remove SkyEye/Dyncom code that is ARMv6-only. 2018-01-02 22:24:12 -05:00
Subv
f5d9c370f8 Memory: Remove all GetPointer usages from the GDB stub. 2017-10-04 11:33:32 -05:00
Huw Pascoe
40a7357877 Fixed type conversion ambiguity 2017-09-30 09:34:35 +01:00
Mat M
43cabebf82 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
Jonathan Hao
360cdf0417 Fix some warnings (#2399) 2017-01-04 13:48:29 -03:00
bunnei
8070c3ea85 core: Replace "AppCore" nomenclature with just "CPU". 2016-12-22 00:27:46 -05:00
bunnei
ee017bc1d7 Address clang-format issues. 2016-12-21 23:48:14 -05:00
bunnei
d4f9119dba core: Consolidate core and system state, remove system module & cleanups. 2016-12-21 23:29:13 -05:00
Lioncash
41039cf76b gdbstub: const correctness changes
Also uses size_t as the length indicator type, as is common with buffers.
2016-12-16 04:06:26 -05:00
Lioncash
043e060072 gdbstub: Remove global variable from public interface
Currently, this is only ever queried, so adding a function to check if the
server is enabled is more sensible.

If directly modifying this externally is ever desirable, it should be done
by adding a function to the interface, rather than exposing implementation
details directly.
2016-12-15 16:37:22 -05:00
Jannik Vogel
ed39f4ed0d gdbstub: Remove unused include 2016-12-05 19:09:16 +01:00
Jannik Vogel
cadf3d6e07 Support mingw cross-compile 2016-12-05 19:09:16 +01:00
James Rowe
8261bb7403 Add mingw compile support 2016-11-13 23:50:46 -07:00
mailwl
087aa831e1 Small fix to let IDA see target.xml 2016-10-28 20:50:45 +03:00
Yuri Kunde Schlesner
3523ab7659 Remove special rules for Windows.h and library includes 2016-09-21 00:16:33 -07:00
Emmanuel Gil Peyrot
7e8d205414 Sources: Run clang-format on everything. 2016-09-18 09:38:01 +09:00
shinyquagsire23
f6ee547dbb gdbstub: E0 should be E00 2016-06-08 14:14:59 -07:00
Lioncash
26b0cdf01d gdbstub: Silence missing prototype warnings 2016-05-10 09:17:07 -04:00
Alexander Laties
68edf2783a fixup simple type conversions where possible 2016-05-07 11:41:55 -04:00
Sam Spilsbury
c098a96f7d gdbstub: Don't check if unsigned int is > 0 2016-04-23 11:54:02 +08:00
polaris-
eae9c73db0 Adopted WinterMute's gdbstub changes
This fixes the comments left on the PR (whitespace, SO_REUSEADDR,
comment changes).
2016-04-06 07:01:00 -04:00
polaris-
ec1195c252 Fix read and write register blocks in gdbstub
Previously, the padding wasn't correctly accounted for which caused the gdbstub to read and write everything after R15 (starting with the dummy FPA registers) incorrectly, which caused CPSR to not be handled correctly. Everything appears to be working as expected with this change.
2015-11-22 07:48:26 -05:00
polaris-
505489551d Fix bug with reading addresses and lengths 2015-11-03 21:50:53 -05:00
polaris-
fd7f61becf Change headers 2015-10-29 06:17:29 -04:00