This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: cyg_io_lookup for /dev/tty0 fails
On Wed, 29 Oct 2008 11:42:33 +0100, Andrew Lunn <andrew@lunn.ch> wrote:
Ok, but I could not figure out how to get access to the assembly code.
Is
there a disassembler built into gdb? And how access it from within
Eclipse? Thanks for hints.
I'm prefer disintegrated development environments (DDE).
arm-elf-objdump -d myprog.elf
You can also use it on an individual object file, ie the one
containing this function.
Andrew
Hi Andrew
The problem occurs in routine cyg_io_lookup which is in iosys.c of eCOS.
The assembly-code looks as follows:
...cut
00103550 <cyg_io_lookup>:
103550: e1a0c00d mov ip, sp
103554: e92dd870 stmdb sp!, {r4, r5, r6, fp, ip, lr, pc}
103558: e59f20c0 ldr r2, [pc, #192] ; 103620 <cyg_io_lookup+0xd0>
10355c: e59f30c0 ldr r3, [pc, #192] ; 103624 <cyg_io_lookup+0xd4>
103560: e24cb004 sub fp, ip, #4 ; 0x4
103564: e24dd00c sub sp, sp, #12 ; 0xc
103568: e1520003 cmp r2, r3
10356c: e1a04000 mov r4, r0
103570: e1a06001 mov r6, r1
103574: e50b2024 str r2, [fp, -#36]
103578: 0a00000c beq 1035b0 <cyg_io_lookup+0x60>
10357c: e24b501c sub r5, fp, #28 ; 0x1c
103580: e5921000 ldr r1, [r2]
103584: e1a00004 mov r0, r4
103588: e1a02005 mov r2, r5
10358c: ebffffa9 bl 103438 <cyg_io_compare>
103590: e3500000 cmp r0, #0 ; 0x0
103594: 1a000007 bne 1035b8 <cyg_io_lookup+0x68>
103598: e51b2024 ldr r2, [fp, -#36]
10359c: e59f3080 ldr r3, [pc, #128] ; 103624 <cyg_io_lookup+0xd4>
1035a0: e282201c add r2, r2, #28 ; 0x1c
1035a4: e1520003 cmp r2, r3
1035a8: e50b2024 str r2, [fp, -#36]
1035ac: 1afffff3 bne 103580 <cyg_io_lookup+0x30>
1035b0: e3e00001 mvn r0, #1 ; 0x1
1035b4: e91ba870 ldmdb fp, {r4, r5, r6, fp, sp, pc}
1035b8: e51b2024 ldr r2, [fp, -#36]
1035bc: e5920004 ldr r0, [r2, #4]
1035c0: e3500000 cmp r0, #0 ; 0x0
1035c4: 050b0020 streq r0, [fp, -#32]
1035c8: 1a00000e bne 103608 <cyg_io_lookup+0xb8>
1035cc: e5923010 ldr r3, [r2, #16]
1035d0: e3530000 cmp r3, #0 ; 0x0
1035d4: 1a000002 bne 1035e4 <cyg_io_lookup+0x94>
1035d8: e3a00000 mov r0, #0 ; 0x0
1035dc: e5862000 str r2, [r6]
1035e0: e91ba870 ldmdb fp, {r4, r5, r6, fp, sp, pc}
1035e4: e24b1020 sub r1, fp, #32 ; 0x20
1035e8: e8910006 ldmia r1, {r1, r2}
1035ec: e24b0024 sub r0, fp, #36 ; 0x24
1035f0: e1a0e00f mov lr, pc
1035f4: e1a0f003 mov pc, r3
1035f8: e3500000 cmp r0, #0 ; 0x0
1035fc: 191ba870 ldmnedb fp, {r4, r5, r6, fp, sp, pc}
103600: e51b2024 ldr r2, [fp, -#36]
103604: eafffff3 b 1035d8 <cyg_io_lookup+0x88>
103608: e24b1020 sub r1, fp, #32 ; 0x20
10360c: ebffffcf bl 103550 <cyg_io_lookup>
103610: e3500000 cmp r0, #0 ; 0x0
103614: 191ba870 ldmnedb fp, {r4, r5, r6, fp, sp, pc}
103618: e51b2024 ldr r2, [fp, -#36]
10361c: eaffffea b 1035cc <cyg_io_lookup+0x7c>
103620: 002005c0 eoreq r0, r0, r0, asr #11
103624: 00200630 eoreq r0, r0, r0, lsr r6
cut....
The "problematic" statement is at address 103590.
The corresponding source code is:
..cut
if (cyg_io_compare(name, t->name, &name_ptr)) {
// FUTURE: Check 'avail'/'online' here
if (t->dep_name) {
res = cyg_io_lookup(t->dep_name, &stunion.h);
if (res != ENOERR) {
return res;
}
} else {
stunion.st = NULL;
}
cut..
t->dep_name is not zero (see debugger screenshot) and hence the line res =
cyg_io_lookup... should be invoked. I am not an ARM-assembler guru and
hence I do not see what's wrong, bhe problem seems to be the code sequence
starting at 1035B8. That's were it jumps to from 103594 - upon return from
cyg_io_compare. What do you think about this?
Robert
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss