Skip to content

Instantly share code, notes, and snippets.

@Arnold1
Created June 1, 2015 21:18
Show Gist options
  • Save Arnold1/145ffe8411b45cb04938 to your computer and use it in GitHub Desktop.
Save Arnold1/145ffe8411b45cb04938 to your computer and use it in GitHub Desktop.
disassemble3
gdb rust_blink
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from rust_blink...done.
(gdb) start
Temporary breakpoint 1 at 0x4434
Starting program: /home/rust_blink
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Temporary breakpoint 1, 0x2a004434 in main ()
(gdb) c
Continuing.
Program received signal SIGBUS, Bus error.
0x36f524a0 in memset () from /lib/arm-linux-gnueabihf/libc.so.6
(gdb) disassemble
Dump of assembler code for function memset:
0x36f52470 <+0>: mov r3, r0
0x36f52474 <+4>: cmp r2, #8
0x36f52478 <+8>: bcc 0x36f524c4 <memset+84>
0x36f5247c <+12>: tst r3, #3
0x36f52480 <+16>: strbne r1, [r3], #1
0x36f52484 <+20>: subne r2, r2, #1
0x36f52488 <+24>: bne 0x36f5247c <memset+12>
0x36f5248c <+28>: and r1, r1, #255 ; 0xff
0x36f52490 <+32>: orr r1, r1, r1, lsl #8
0x36f52494 <+36>: orr r1, r1, r1, lsl #16
0x36f52498 <+40>: mov r12, r1
0x36f5249c <+44>: subs r2, r2, #8
=> 0x36f524a0 <+48>: stmiacs r3!, {r1, r12}
0x36f524a4 <+52>: subscs r2, r2, #8
0x36f524a8 <+56>: stmiacs r3!, {r1, r12}
0x36f524ac <+60>: subscs r2, r2, #8
0x36f524b0 <+64>: stmiacs r3!, {r1, r12}
0x36f524b4 <+68>: subscs r2, r2, #8
0x36f524b8 <+72>: stmiacs r3!, {r1, r12}
0x36f524bc <+76>: bcs 0x36f5249c <memset+44>
0x36f524c0 <+80>: and r2, r2, #7
0x36f524c4 <+84>: subs r2, r2, #1
---Type <return> to continue, or q <return> to quit--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment