Hi
I have written a small program to clear the memory (at91sam7x512-based board). Actually it works fine, but I can not debug it. The program uses cyg_user_start to initialize as task as follows:

#include <cyg/kernel/kapi.h>            /* All the kernel specific stuff */
#include <cyg/infra/diag.h>               // bring in e. g. cyg_type.h

void cyg_user_start(void)
{
    diag_printf("\nmemset start");
    cyg_thread_create(TASK_PRIO, mytask, (cyg_addrword_t) 0, "mytask",
                        (void*) &stack, STACKSIZE, &thread, &thread_obj);
    diag_printf("\ncreate done\n");
    cyg_thread_resume(thread);
    diag_printf("\nresume done\n");   // never
}

I am working with Eclipse Ganymede/CDT conned via LAN to a BDI2000 JTAG device. When setting a breakpoint at diag_printf, the console output (see attachment) tells me it is reached, but no variables are displayed and the system can no longer be debugged (timeout). Having a closer look at the console output, it seams to me that gdb-command 104 looks suspicous. addr 0x000000 is just plain wrong.

I also have a similar program that does not use a task, but instead mytask is replaced by a procedure - and hence kapi.h is not included. But all the rest is the same - especially the same ecos is used to build the program. With this simpler program - the debuggin works fine. I do not understand why.
  Robert
88-gdb-set confirm off
88^done
89-gdb-set width 0
(gdb) 
89^done
90-gdb-set height 0
(gdb) 
90^done
91-interpreter-exec console echo
(gdb) 
91^done
92-gdb-show prompt
(gdb) 
92^done,value="(gdb) "
93-gdb-set new-console on
(gdb) 
93^error,msg="No symbol \"new\" in current context."
94 target remote 192.168.0.21:2001
(gdb) 
&"target remote 192.168.0.21:2001\n"
target remote 192.168.0.21:2001
=thread-created,id="1"
~"0x00000000 in ?? ()\n"
0x00000000 in ?? ()
*stopped
94^done
95 info proc
(gdb) 
&"info proc\n"
&"Undefined info command: \"proc\".  Try \"help info\".\n"
95^error,msg="Undefined info command: \"proc\".  Try \"help info\"."
96 info program
(gdb) 
&"info program\n"
~"Debugging a target over a serial line.\n"
~"Program stopped at 0x0.\n"
~"It stopped with signal SIGSTOP, Stopped (signal).\n"
~"Type \"info stack\" or \"info registers\" for more information.\n"
96^done
97 info threads
(gdb) 
&"info threads\n"
&"warning: RMT ERROR : failed to get remote thread list.\n"
~"* 1 Thread <main>  0x00000000 in ?? ()\n"
97^done
98-stack-info-depth
(gdb) 
98^done,depth="1"
99-stack-list-frames 0 1
(gdb) 
99^done,stack=[frame={level="0",addr="0x00000000",func="??"}]
100-data-list-changed-registers
(gdb) 
100^done,changed-registers=["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25"]
101 info sharedlibrary
(gdb) 
&"info sharedlibrary\n"
~"No shared libraries loaded at this time.\n"
101^done
102-environment-directory -r /home/rwb/ws090108/memset 
/home/rwb/ws090108/memset/.settings /home/rwb/ws090108/memset/Debug
(gdb) 
102^done,source-path="/home/rwb/ws090108/memset:/home/rwb/ws090108/memset/.settings:/home/rwb/ws090108/memset/Debug:$cdir:$cwd"
103-data-list-register-names
(gdb) 
103^done,register-names=["r0","r1","r2","r3","r4","r5","r6","r7","r8","r9","r10","r11","r12","sp","lr","pc","f0","f1","f2","f3","f4","f5","f6","f7","fps","cpsr","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""]
104-break-insert memset.c:72
(gdb) 
104^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00000000",file="/home/rwb/ecos/packages/infra/current/src/memset.c",line="72",times="0",original-location="memset.c:72"}
(gdb) 
105-data-disassemble -s 0x0 -e 0x64 -- 0
105^done,asm_insns=[{address="0x00000000",inst="ldr\tpc, [pc, #24]\t; 
0x20"},{address="0x00000004",inst="ldr\tpc, [pc, #24]\t; 
0x24"},{address="0x00000008",inst="ldr\tpc, [pc, #24]\t; 
0x28"},{address="0x0000000c",inst="ldr\tpc, [pc, #24]\t; 
0x2c"},{address="0x00000010",inst="ldr\tpc, [pc, #24]\t; 
0x30"},{address="0x00000014",inst="andeq\tr0, r0, 
r0"},{address="0x00000018",inst="ldr\tpc, [pc, #24]\t; 
0x38"},{address="0x0000001c",inst="ldr\tpc, [pc, #24]\t; 
0x3c"},{address="0x00000020",inst="andseq\tr0, r0, r0, asr 
#32"},{address="0x00000024",inst="andseq\tr0, r0, r0, lsl 
#4"},{address="0x00000028",inst="andseq\tr0, r0, r4, lsr 
#4"},{address="0x0000002c",inst="andseq\tr0, r0, r0, asr 
r2"},{address="0x00000030",inst="andseq\tr0, r0, r12, ror 
#4"},{address="0x00000034",inst="andeq\tr0, r0, 
r0"},{address="0x00000038",inst="andseq\tr0, r0, r12, ror 
#6"},{address="0x0000003c",inst="andseq\tr0, r0, r4, lsr 
r3"},{address="0x00000040",inst="mvn\tr0, #255\t; 
0xff"},{address="0x00000044",inst="mov\tr1, #256\t; 
0x100"},{address="0x00000048",inst="str\tr1, [r0, 
#96]"},{address="0x0000004c",inst="str\tr1, [r0, 
#112]"},{address="0x00000050",inst="ldr\tr0, [pc, #1268]\t; 
0x54c"},{address="0x00000054",inst="ldr\tr1, [r0, 
#104]"},{address="0x00000058",inst="ands\tr1, r1, #8\t; 
0x8"},{address="0x0000005c",inst="beq\t0x54"},{address="0x00000060",inst="mov\tr1,
 #0\t; 0x0"}]
(gdb) 
106-stack-list-arguments 0 0 0
106^done,stack-args=[frame={level="0",args=[]}]
107-stack-list-locals 0
(gdb) 
107^done,locals=[]
(gdb) 
108-exec-continue
108^running
*running,thread-id="1"
(gdb) 
*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",thread-id="1",frame={addr="0x00000000",func="??",args=[]}
109 info threads
(gdb) 
&"info threads\n"
&"warning: RMT ERROR : failed to get remote thread list.\n"
~"* 1 Thread <main>  0x00000000 in ?? ()\n"
109^done
110-stack-info-depth
(gdb) 
110^done,depth="1"
111-stack-list-frames 0 1
(gdb) 
111^done,stack=[frame={level="0",addr="0x00000000",func="??"}]
112-data-list-changed-registers
(gdb) 
112^done,changed-registers=["0","1","2","3","4","12","13","14","25"]
113 info sharedlibrary
(gdb) 
&"info sharedlibrary\n"
~"No shared libraries loaded at this time.\n"
113^done
(gdb) 
114-stack-list-arguments 0 0 0
114^done,stack-args=[frame={level="0",args=[]}]
115-stack-list-locals 0
(gdb) 
115^done,locals=[]
(gdb) 

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply via email to