PCSX2 Documentation/GNU Debugger Tips: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 22: Line 22:
*Add breakpoint to stop program: <code>break <file>:<line></code> or <code>break <function></code>
*Add breakpoint to stop program: <code>break <file>:<line></code> or <code>break <function></code>
*add a condition: <code>break <file>:<line> if <ARG> == 0</code>
*add a condition: <code>break <file>:<line> if <ARG> == 0</code>
*Print variable/memory/register basic var: <code>print <var> </code>
*Print variable/memory/register basic var: <code>print <nowiki><var></nowiki> </code>
*pointer var: <code>print <*var></code>
*pointer var: <code>print <*var></code>
*print memory: <code>x <Oxlocation></code>
*print memory: <code>x <Oxlocation></code>
Line 30: Line 30:
A program have a limited range of memory that it can access. When you try to read/write outside, the kernel generate an error named segmentation fault. It is a critical error and generally it just crash. It is a bit difficult on PCSX2 because recompiler use this mechanism for optimization. So segmentation fault inside recompiler are normal and expected.
A program have a limited range of memory that it can access. When you try to read/write outside, the kernel generate an error named segmentation fault. It is a critical error and generally it just crash. It is a bit difficult on PCSX2 because recompiler use this mechanism for optimization. So segmentation fault inside recompiler are normal and expected.
You can control signal behavior with the handle command for example.
You can control signal behavior with the handle command for example.
*don't stop on SIGSEGV: handle SIGSEGV nostop
*don't stop on SIGSEGV: <code>handle SIGSEGV nostop</code>


==GDB basic gui==
==GDB basic gui==
You can attach gdb to any process of your system. It will stop the process and show the current execution.
You can attach gdb to any process of your system. It will stop the process and show the current execution.
*hint: to get the pcsx2 process id: ps aux |grep pcsx2
*hint: <code>to get the pcsx2 process id: ps aux |grep pcsx2</code>
*attach the process: attach <Process_ID>
*attach the process: <code>attach <Process_ID></code>
*GDB contains several views. You can see code source, ASM or register.
 
*source code: ctrl x ctrl A
GDB contains several views. You can see code source, ASM or register.
*2 panels: ctrl x ctrl 1
*source code: <code>ctrl x ctrl A</code>
*3 panels: ctrl x ctrl 2
*2 panels: <code>ctrl x ctrl 1</code>
*3 panels: <code>ctrl x ctrl 2</code>
 
 
{{PCSX2 Documentation Navbox}}
ninja
782

edits

Navigation menu