gdb

Comment 6 for bug 1157109

Revision history for this message
Muhammad Omair Javaid (omair-javaid) wrote : Re: [Bug 1157109] Re: record mode confuses disassembler

I recompiled the code with no changes on a pandaboard. (Linux
3.5.0-213-omap4 #20-Ubuntu SMP PREEMPT)

GCC version: 4.7.2

Let me recheck this with your binaries.

thanks!

On 20 September 2013 14:47, Christophe Lyon <email address hidden> wrote:
> Did you re-compile the C source I attached or did you use the binary I
> supplied?
>
> Your disassembly does not match the contents of test1.thumb I supplied.
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1157109
>
> Title:
> record mode confuses disassembler
>
> Status in GNU Debugger:
> New
> Status in Linaro GDB:
> Incomplete
>
> Bug description:
> As of current GDB trunk (2013-03-18), using record mode can confuse
> the disassembler.
>
> I attach test1.c and test1.thumb (compiled in the default thumb mode
> with gcc -g -o test1.thumb test1.c).
>
> $ gdb test1.thumb
> GNU gdb (GDB) 7.6.50.20130317-cvs
> [...]
> (gdb) b main
> Breakpoint 1 at 0x8396: file test1.c, line 5.
> (gdb) b test1.c:8
> Breakpoint 2 at 0x83b0: file test1.c, line 8.
> (gdb) r
> Starting program: /home/lyon/test1.thumb
>
> Breakpoint 1, main () at test1.c:5
> 5 int i=0;
> (gdb) target record-full
> (gdb) disassemble main
> Dump of assembler code for function main:
> 0x00008390 <+0>: push {r7, lr}
> 0x00008392 <+2>: sub sp, #8
> 0x00008394 <+4>: add r7, sp, #0
> => 0x00008396 <+6>: mov.w r3, #0
> 0x0000839a <+10>: str r3, [r7, #4]
> 0x0000839c <+12>: movw r0, #33808 ; 0x8410
> 0x000083a0 <+16>: movt r0, #0
> 0x000083a4 <+20>: blx 0x82e4 <puts>
> 0x000083a8 <+24>: ldr r3, [r7, #4]
> 0x000083aa <+26>: add.w r3, r3, #1
> 0x000083ae <+30>: str r3, [r7, #4]
> 0x000083b0 <+32>: mov r0, r3
> 0x000083b2 <+34>: add.w r7, r7, #8
> 0x000083b6 <+38>: mov sp, r7
> 0x000083b8 <+40>: pop {r7, pc}
> End of assembler dump.
> (gdb) c
> Continuing.
> Process record doesnt support thumb32 instruction 0x300f04f at address 0x8396.
> main () at test1.c:5
> 5 int i=0;
> Process record: failed to record execution log.
> (gdb) disassemble main
> Dump of assembler code for function main:
> 0x00008390 <+0>: push {r7, lr}
> 0x00008392 <+2>: sub sp, #8
> 0x00008394 <+4>: add r7, sp, #0
> => 0x00008396 <+6>: mov.w r3, #0
> 0x0000839a <+10>: ; <UNDEFINED> instruction: 0xde01
> 0x0000839c <+12>: movw r0, #33808 ; 0x8410
> 0x000083a0 <+16>: movt r0, #0
> 0x000083a4 <+20>: blx 0x82e4 <puts>
> 0x000083a8 <+24>: ldr r3, [r7, #4]
> 0x000083aa <+26>: add.w r3, r3, #1
> 0x000083ae <+30>: str r3, [r7, #4]
> 0x000083b0 <+32>: mov r0, r3
> 0x000083b2 <+34>: add.w r7, r7, #8
> 0x000083b6 <+38>: mov sp, r7
> 0x000083b8 <+40>: pop {r7, pc}
> End of assembler dump.
>
>
> Notice how instruction at 0x8396 became UNDEFINED.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/gdb/+bug/1157109/+subscriptions