Homebrew Debugging homebrew

  • Thread starter Thread starter capz
  • Start date Start date
  • Views Views 5,578
  • Replies Replies 4

capz

Well-Known Member
Newcomer
Joined
Nov 28, 2014
Messages
74
Reaction score
25
Trophies
0
Location
cake town
XP
132
Country
Netherlands
So i've been poking around with the homebrew sdk for a little while now and want to port some existing code that I have to it. I got things to compile, but it's really hard to see which parts are malfunctioning on the 3ds because i can't debug it. I dont get any stdout messages in citra (can't seem to find anything) either so I was wondering.. A few people have written homebrew apps/games, so I figured I'd ask here; how do you guys and girls test/debug your code?
 
So i've been poking around with the homebrew sdk for a little while now and want to port some existing code that I have to it. I got things to compile, but it's really hard to see which parts are malfunctioning on the 3ds because i can't debug it. I dont get any stdout messages in citra (can't seem to find anything) either so I was wondering.. A few people have written homebrew apps/games, so I figured I'd ask here; how do you guys and girls test/debug your code?
I generally try to make my projects so they can cross compile to windows as well. That way I can test core logic in windows first. For 3ds specific code I will usually start adding print statements. If it gets really bad then I use a function that prints a debug string to the console and waits for a key press (and waits for the release too). And I add it liberally to the code I am troubleshooting in order to isolate the issue. It can take a few builds to find the issue. If you test frequently then you know where to start looking.
 
ctrulib has a console that you can activate on one or other screen and print messages to, very useful for narrowing down where/what the problem is in your code. NTR (v1.x for o3ds or v2 for n3ds) actually has a real debugger, haven't used it personally tho.
 
So i've been poking around with the homebrew sdk for a little while now and want to port some existing code that I have to it. I got things to compile, but it's really hard to see which parts are malfunctioning on the 3ds because i can't debug it. I dont get any stdout messages in citra (can't seem to find anything) either so I was wondering.. A few people have written homebrew apps/games, so I figured I'd ask here; how do you guys and girls test/debug your code?


For me, i just use my O3DS ejecting SD card during tests including in the LUA script a button who just crash my LUA interpreter so i can restart the code instantly without going back to hb_menu or home menu.
 
I generally try to make my projects so they can cross compile to windows as well. That way I can test core logic in windows first. For 3ds specific code I will usually start adding print statements. If it gets really bad then I use a function that prints a debug string to the console and waits for a key press (and waits for the release too). And I add it liberally to the code I am troubleshooting in order to isolate the issue. It can take a few builds to find the issue. If you test frequently then you know where to start looking.
Yeah I've been trying to shoehorn my desktop code into the 3ds on and off but until i get to the level of crossplatform support that would allow that, I guess I'll need to build minimal test cases first.

For me, i just use my O3DS ejecting SD card during tests including in the LUA script a button who just crash my LUA interpreter so i can restart the code instantly without going back to hb_menu or home menu.
that would be great for C++ :P I envy this

ctrulib has a console that you can activate on one or other screen and print messages to, very useful for narrowing down where/what the problem is in your code. NTR (v1.x for o3ds or v2 for n3ds) actually has a real debugger, haven't used it personally tho.
That might be worth looking into, I haven't attempted to play around with NTR yet
 

Site & Scene News

Popular threads in this forum