Skip to content

$cpsr struct not always defined, extract bits from $cpsr manually#24

Merged
gdbinit merged 1 commit intogdbinit:masterfrom
StalkR:cpsr
Mar 25, 2014
Merged

$cpsr struct not always defined, extract bits from $cpsr manually#24
gdbinit merged 1 commit intogdbinit:masterfrom
StalkR:cpsr

Conversation

@StalkR
Copy link
Contributor

@StalkR StalkR commented Mar 25, 2014

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).

gdbinit added a commit that referenced this pull request Mar 25, 2014
$cpsr struct not always defined, extract bits from $cpsr manually
@gdbinit gdbinit merged commit e7c7a2e into gdbinit:master Mar 25, 2014
@StalkR StalkR deleted the cpsr branch March 25, 2014 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants