Debugging ps3 app using ps3 hen?

It depends on what you need to debug.

For instance, I have developed various homebrews and never have used DEX.

What I do is to add code to the application that write to a log file on the disk. Then I write messages at various points of the code. That let me trace the function that I'm debugging.

Another useful functions are: a combo for reboot and FTP to upload the updates. Here webMAN can help a lot. It also let you dump the memory, but this is a little limited on HEN.

The rest is patience and skills
 
I want to make a homebrew to ps3 but i have ps3 hen mod is it possible with it to debugging

yes, it can be done. I've built a couple of PS3 homebrew apps already and I only have a super-slim ps3 w/ HEN.

Adding to aldo's tips and tricks:

I have built a debug logger library with network support (TCP and UDP) so instead of writing to file, I just leave a listener running on my computer and I get all the log output directly from my app. It's the same concept as saving to file but it saves me a bit of time.
You can get the library for psl1ght here: https://github.com/bucanero/psl1ght-libs/tree/master/dbglogger

I also leave a debug thread running in the app that scans the /dev_hdd0/tmp/ for a file like "stop.txt" . If the file exists, the thread kills the app process and returns to XMB. It's quite useful for me when developing, as some times the app might become unresponsive (for whatever reason, endless loop, memory leak, et al.) so I just FTP a blank "stop.txt" file and I can safely return to XMB.

Now that I'm talking about it, I should have included that "kill thread scanner" into my debug logger library! and perhaps instead of a file, leave a TCP listening socket so I could kill the app with a simple netcat connection.
 
Last edited:
yes, I can be done. I've built a couple of PS3 homebrew apps already and I only have a super-slim ps3 w/ HEN.

Adding to aldo's tips and tricks:

I have built a debug logger library with network support (TCP and UDP) so instead of writing to file, I just leave a listener running on my computer and I get all the log output directly from my app. It's the same concept as saving to file but it saves me a bit of time.
You can get the library for psl1ght here: https://github.com/bucanero/psl1ght-libs/tree/master/dbglogger

I also leave a debug thread running in the app that scans the /dev_hdd0/tmp/ for a file like "stop.txt" . If the file exists, the thread kills the app process and returns to XMB. It's quite useful for me when developing, as some times the app might become unresponsive (for whatever reason, endless loop, memory leak, et al.) so I just FTP a blank "stop.txt" file and I can get safely return to XMB.

Now that I'm talking about it, I should have included that "kill thread scanner" into my debug logger library! and perhaps instead of a file, leave a TCP listening socket so I could kill the app with a simple netcat connection.

webMAN MOD has many debugging functions including load/unload proc modules, load/unload vsh plugins, dump memory, pause/continue rsx processor, peek/poke, cleanup scripting, screenshots, game pad emulation, remote reboot, etc.

You can consider adding more functions (if the current ones are not enough), instead of having another plugin/thread running in background.
 
webMAN MOD has many debugging functions including load/unload proc modules, load/unload vsh plugins, dump memory, pause/continue rsx processor, peek/poke, cleanup scripting, screenshots, game pad emulation, remote reboot, etc.

just to be sure, can I kill a running foreground process from wMM ? I remember I can unload a vsh plugin but I missed if I can kill the running game or application.

You can consider adding more functions (if the current ones are not enough), instead of having another plugin/thread running in background.

sorry for the confusion, my "fail-safe" thread is not a plugin, is only a simple thread running inside the application I work on.
A thread with a short code like:

Code:
void debug_dummy(void* data)
{
    while (1)
    {
        if (file_exists("/dev_hdd0/tmp/stop.txt") == 0)
        {
            unlink_secure("/dev_hdd0/tmp/stop.txt");
              sysProcessExit(1);
        }
        usleep(1000*1000);
    }
}

At least in my dev tests, with this thread trick I can usually recover from some silly mistakes like "endless loops".
of course, if the app really crashes in a big nasty way, the thread will die too.
 
just to be sure, can I kill a running foreground process from wMM ? I remember I can unload a vsh plugin but I missed if I can kill the running game or application.

There is not a direct command to kill apps but it can be added easily...

if you go to Game Plugins section of /home.ps3mapi

When you press the Set button it will open a new url like: /gameplugin.ps3mapi?proc=<pid>

The number <pid> is the process id of the running game or application.

Then you can kill that process using: /syscall.ps3?19|<pid> (replace <pid> with the process id number)

Example:
http://10.0.0.8/syscall.ps3?19|16908800[/QUOTE]
 
thanks @aldostools ! great information, I had no idea about it
I'll try it next time my code breaks while I'm doing development :D

perhaps it's not so useful for everyone, but having a "kill" button or direct link from the game plugin page would be really nice. I hope it can be added to a future version

cheers
 
Now that I'm talking about it, I should have included that "kill thread scanner" into my debug logger library! and perhaps instead of a file, leave a TCP listening socket so I could kill the app with a simple netcat connection.

I've updated my dbglogger library and added this little "failsafe" option I mentioned above. It supports both a local file trigger and a network (TCP) trigger.

To use it with the network trigger, just call the function with the listening port:
Code:
dbglogger_failsafe("5555");

then you can kill the app at any time with a connection to ps3-ip:5555. For example, using netcat:
nc 192.168.1.111 5555
 
Last edited:

Similar threads

Back
Top