1. LeviathaninWaves

    OP LeviathaninWaves Newbie
    Newcomer

    Joined:
    Jul 15, 2020
    Messages:
    4
    Country:
    United States
    Hey.

    I want to rewrite some of nxdbg's code to bring it up to date with current fw and libnx builds. I just jumped into Switch homebrew recently so I'm obviously going to be stumped on some things.

    nxdbg will not build using the most recent libnx. After studying the main.c for nxdbg and some of the services and kernel code in libnx it became obvious as to why it won't build. In libnx, some of the functions and the arguments were renamed or changed significantly over time (some syscalls in svc as well as pmdmnt functions).

    My first question is about ThreadContext. nxdbg uses ThreadContext to (from what I understand) display the contents of the cpu registers x0-x30, the stack pointer and the program counter. But the current ThreadContext struct in libnx seems to imply there is much more to it than what is supported by nxdbg. Namely the fpu registers, Aarch32 registers... does the Nintendo Switch actually use these in an official capacity? I'd hate to rewrite all this and code more than is necessary.

    Second question. I'm not an expert at kernel programming and looking at the code I'm not sure what exactly kernel events are useful for in Switch dev let alone how to use them here. Does anyone have any tips or example code that would help me understand those better?

    I'm interested in seeing how powerful of a debugger can be implemented on the Switch without the need for a secondary device.
     
  2. masagrator

    masagrator The patches guy
    Member

    Joined:
    Oct 14, 2018
    Messages:
    4,234
    Country:
    Poland
    Try to ask this on ReSwitched discord. You can find there Atmosphere and libnx devs.
     
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - kernel, events, nxdbg