How would you debug a segmentation fault or a memory leak on an embedded target with limited debugging tools?