gdbinit/Gdbinit — pull request #24 by StalkR (2014-03-25 15:40:19+00:00)
Title: $cpsr struct not always defined, extract bits from $cpsr manually

On the ARMv7 boxes of http://ioarm.smashthestack.org/ $cpsr struct isn't defined, therefore when fields like $cpsr->n are accessed it breaks hard and context cannot be displayed.

$ uname -a
Linux arm1 3.8.13.13-30068-g2296bce #12 SMP PREEMPT Mon Feb 3 15:50:09 CET 2014 armv7l armv7l armv7l GNU/Linux
$ gdb
GNU gdb (GDB) 7.5.91.20130417-cvs-ubuntu
This GDB was configured as "arm-linux-gnueabihf".
gdb$ p $cpsr
$1 = 0x60000070
gdb$ p $cpsr->n
Attempt to extract a component of a value that is not a structure pointer.

Edited all struct accesses with shift/and operations so it works in all cases.

Also fixed ddump (show data window) and context (show stack) that wasn't supporting ARM (using x86/x86_64 specific $ds).