public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Debugging Thumb code
@ 2009-03-20 15:18 John Dallaway
  2009-03-20 18:16 ` [ECOS] " Sergei Gavrikov
  0 siblings, 1 reply; 4+ messages in thread
From: John Dallaway @ 2009-03-20 15:18 UTC (permalink / raw)
  To: Ilija Kocho, Sergei Gavrikov; +Cc: eCos Discussion

Hi Ilija and Sergei

Many thanks for your eCos 3.0 beta 1 testing reports.

I wonder if you're also able to check for correct debugging of eCos
applications built for Thumb? Since one of you is using a big-endian ARM
target and the other a little-endian ARM target you can together provide
good coverage.

For avoidance of doubt:

a) eCos should build for Thumb on ARM architecture simply by enabling
CYGHWR_THUMB. I strongly recommend using a completely new build tree and
enabling CYGHWR_THUMB before invoking make for the first time.

b) The standard build of RedBoot should support debugging of both ARM
and Thumb applications. You do not need to rebuild RedBoot.

If you're able to confirm the correct operation of Thumb breakpoints,
single stepping and backtraces in a simple application which runs in a
loop such as the "twothreads" example application this would be very
helpful. You can build the twothreads example as follows:

  cd /opt/ecos/ecos-3.0b1/examples
  make twothreads INSTALL_DIR=/path/to/ecos-build/install

John Dallaway

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ECOS] Re: Debugging Thumb code
  2009-03-20 15:18 [ECOS] Debugging Thumb code John Dallaway
@ 2009-03-20 18:16 ` Sergei Gavrikov
  2009-03-23  7:20   ` Sergei Gavrikov
  0 siblings, 1 reply; 4+ messages in thread
From: Sergei Gavrikov @ 2009-03-20 18:16 UTC (permalink / raw)
  To: John Dallaway; +Cc: Ilija Kocho, eCos Discussion

[-- Attachment #1: Type: text/plain, Size: 10524 bytes --]

On Fri, Mar 20, 2009 at 02:16:59PM +0000, John Dallaway wrote:
> Hi Ilija and Sergei
> 
> Many thanks for your eCos 3.0 beta 1 testing reports.
> 
> I wonder if you're also able to check for correct debugging of eCos
> applications built for Thumb? Since one of you is using a big-endian ARM
> target and the other a little-endian ARM target you can together provide
> good coverage.
> 
> For avoidance of doubt:
> 
> a) eCos should build for Thumb on ARM architecture simply by enabling
> CYGHWR_THUMB. I strongly recommend using a completely new build tree and
> enabling CYGHWR_THUMB before invoking make for the first time.
> 
> b) The standard build of RedBoot should support debugging of both ARM
> and Thumb applications. You do not need to rebuild RedBoot.
> 
> If you're able to confirm the correct operation of Thumb breakpoints,
> single stepping and backtraces in a simple application which runs in a
> loop such as the "twothreads" example application this would be very
> helpful. You can build the twothreads example as follows:
> 
>   cd /opt/ecos/ecos-3.0b1/examples
>   make twothreads INSTALL_DIR=/path/to/ecos-build/install

Hi John

I will be to fulfil a job and paste the below

I will place a conclusion at the line the below

ALL WORKS FOR MY TARGET

~$ cd /tmp
/tmp$ rm -f -r t
/tmp$ mkdir t
/tmp$ cd t
/tmp/t$ ecosconfig new olpce2294
U CYGHWR_HAL_ARM_LPC2XXX, new inferred value LPC2294
/tmp/t$ cp ecos.ecc{,.0}
/tmp/t$ vi ecos.ecc
/tmp/t$ diff -U 5 ecos.ecc{.0,}
--- ecos.ecc.0  2009-03-20 18:26:46.000000000 +0200
+++ ecos.ecc	2009-03-20 18:27:08.000000000 +0200
@@ -2469,11 +2469,11 @@
     #     CYGINT_HAL_ARM_THUMB_ARCH == 1
     #   --> 1
 
     # Flavor: bool
     # No user value, uncomment the following line to provide one.
-    # user_value 0
+    user_value 1
     # value_source default
     # Default value: 0
 
     # The following properties are affected by this value
     # option CYGBLD_ARM_ENABLE_THUMB_INTERWORK
/tmp/t$ ecosconfig resolve
/tmp/t$ cp ecos.ecc{,.1}
/tmp/t$ vi ecos.ecc
/tmp/t$ diff -U 5 ecos.ecc{.1,}
--- ecos.ecc.1	2009-03-20 18:28:39.000000000 +0200
+++ ecos.ecc	2009-03-20 18:28:56.000000000 +0200
@@ -202,11 +202,11 @@
 # flags.
 #
 cdl_option CYGBLD_GLOBAL_CFLAGS {
     # Flavor: data
     # No user value, uncomment the following line to provide one.
-    # user_value "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings  -mthumb  -mthumb-interwork -mcpu=arm7tdmi -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions"
+    user_value "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings  -mthumb  -mthumb-interwork -mcpu=arm7tdmi -g -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions"
     # value_source default
     # Default value:  CYGBLD_GLOBAL_WARNFLAGS . CYGBLD_ARCH_CFLAGS .
     #                                 "-mcpu=arm7tdmi -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" 
     #     CYGBLD_GLOBAL_WARNFLAGS == "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings "
     #     CYGBLD_ARCH_CFLAGS == " -mthumb  -mthumb-interwork "
/tmp/t$ ecosconfig resolve
/tmp/t$ ecosconfig tree&&make -s
headers finished
/opt/trunk/devo/ecos/packages/hal/arm/lpc2xxx/var/current/src/hal_diag.c: In function ‘cyg_hal_plf_serial_isr’:
/opt/trunk/devo/ecos/packages/hal/arm/lpc2xxx/var/current/src/hal_diag.c:260: warning: pointer targets in passing argument 1 of ‘cyg_hal_is_break’ differ in signedness
build finished
/tmp/t$ make -C $ECOS_REPOSITORY/../examples clean INSTALL_DIR=`pwd`/install
make: Entering directory `/opt/trunk/devo/ecos/examples'
rm -f hello hello.o twothreads twothreads.o
rm -f simple-alarm simple-alarm.o serial serial.o
rm -f instrument-test instrument-test.o
make: Leaving directory `/opt/trunk/devo/ecos/examples
/tmp/t$ make -C $ECOS_REPOSITORY/../examples twothreads INSTALL_DIR=`pwd`/install
make: Entering directory `/opt/trunk/devo/ecos/examples'
arm-eabi-gcc -c -o twothreads.o -I/tmp/t/install/include -Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mthumb -mthumb-interwork -mcpu=arm7tdmi -g -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions twothreads.c
cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
arm-eabi-gcc -nostartfiles -L/tmp/t/install/lib -Ttarget.ld -mthumb -mthumb-interwork -mcpu=arm7tdmi -Wl,--gc-sections -Wl,-static -g -nostdlib -o twothreads twothreads.o
make: Leaving directory `/opt/trunk/devo/ecos/examples'
/tmp/t$ arm-eabi-gdb $ECOS_REPOSITORY/../examples/twothreads
GNU gdb (eCosCentric GNU tools 4.3.2-sw) 6.8.50.20080706
Copyright (C) 2008 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 "--host=i686-pc-linux-gnu --target=arm-eabi".
For bug reporting instructions, please see:
<http://bugs.ecos.sourceware.org/>...
(gdb) set logging on
Copying output to gdb.txt.
(gdb) set remotebaud 230400
(gdb) target remote /dev/ttyUSB0
Remote debugging using /dev/ttyUSB0
0x00008028 in ?? ()
(gdb) load
Loading section .rom_vectors, size 0x40 lma 0x81010000
Loading section .text, size 0xd6b4 lma 0x81010040
Loading section .rodata, size 0x9c0 lma 0x8101d6f4
Loading section .data, size 0x324 lma 0x8101e0b4
Start address 0x81010040, load size 58328
Transfer rate: 17 KB/sec, 299 bytes/write.
(gdb) b main
Breakpoint 1 at 0x8101af1a: file /opt/trunk/devo/ecos/packages/language/c/libc/startup/current/src/main.cxx, line 114.
(gdb) b simple_program
Breakpoint 2 at 0x810106ac: file twothreads.c, line 43.
(gdb) c
Continuing.
Entering twothreads' cyg_user_start() function
[Switching to Thread 3]

Breakpoint 2, simple_program (data=0) at twothreads.c:43
43	  int message = (int) data;
Current language:  auto; currently c
(gdb) bt
#0  simple_program (data=0) at twothreads.c:43
#1  0x81014052 in Cyg_HardwareThread::thread_entry (thread=0x81024768)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:9
(gdb) info threads
[New Thread 1]
[New Thread 2]
[New Thread 4]
  4 Thread 4 ( Name: Thread B, State: ready, Priority: 4 )  Cyg_HardwareThread::thread_entry (thread=0x0)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:84
  3 Thread 2 ( Name: main, State: ready, Priority: 10 )  Cyg_HardwareThread::thread_entry (thread=0x0)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:84
  2 Thread 1 ( Name: Idle Thread, State: ready, Priority: 31 )  Cyg_HardwareThread::thread_entry (thread=0x0)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:84
* 1 Thread 3 ( Name: Thread A, State: running, Priority: 4 )  simple_program (
    data=0) at twothreads.c:43
(gdb) l
43	  int message = (int) data;
44	  int delay;
45	
46	  printf("Beginning execution; thread data is %d\n", message);
47	
48	  cyg_thread_delay(200);
49	
50	  for (;;) {
51	    delay = 200 + (rand() % 50);
52	
(gdb) b 51
Breakpoint 3 at 0x810106c4: file twothreads.c, line 51.
(gdb) c
Continuing.
Beginning execution; thread data is 0
[Switching to Thread 4]

Breakpoint 2, simple_program (data=1) at twothreads.c:43
43	  int message = (int) data;
(gdb) n
46	  printf("Beginning execution; thread data is %d\n", message);
(gdb) 
Beginning execution; thread data is 1
48	  cyg_thread_delay(200);
(gdb) c
Continuing.
[Switching to Thread 2]

Breakpoint 1, main (argc=1, argv=0x8102213c)
    at /opt/trunk/devo/ecos/packages/language/c/libc/startup/current/src/main.cxx:114
114	    Cyg_Thread::self()->suspend();
Current language:  auto; currently c++
114	    Cyg_Thread::self()->suspend();
Current language:  auto; currently c++
(gdb) n
[Switching to Thread 3]

Breakpoint 3, simple_program (data=0) at twothreads.c:51
51	    delay = 200 + (rand() % 50);
Current language:  auto; currently c
(gdb) 
55	    cyg_mutex_lock(&cliblock); {
(gdb) 
[Switching to Thread 4]

Breakpoint 3, simple_program (data=1) at twothreads.c:51
51	    delay = 200 + (rand() % 50);
(gdb) d
Delete all breakpoints? (y or n) y
(gdb) c
Continuing.
Thread 1: and now a delay of 230 clock ticks
Thread 0: and now a delay of 239 clock ticks
Thread 1: and now a delay of 221 clock ticks
Thread 0: and now a delay of 214 clock ticks
Thread 1: and now a delay of 224 clock ticks
Thread 0: and now a delay of 243 clock ticks

Program received signal SIGINT, Interrupt.
[Switching to Thread 1]
idle_thread_main (data=0)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:1228
1228	        idle_thread_loops[CYG_KERNEL_CPU_THIS()]++;
Current language:  auto; currently c++
(gdb) bt
#0  idle_thread_main (data=0)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:1228
#1  0x81014052 in Cyg_HardwareThread::thread_entry (thread=0x8101f728)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:94
(gdb) info th 
  4 Thread 4 ( Name: Thread B, State: sleeping, Priority: 4 )  0x8101fff0 in Cyg_Scheduler::scheduler ()
  3 Thread 2 ( Name: main, State: suspended, Priority: 10 )  0x8101fff0 in Cyg_Scheduler::scheduler ()
* 2 Thread 1 ( Name: Idle Thread, State: running, Priority: 31 )  idle_thread_main (data=0)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:1228
  1 Thread 3 ( Name: Thread A, State: sleeping, Priority: 4 )  0x8101fff0 in Cyg_Scheduler::scheduler ()
(gdb) c
Continuing.
Thread 1: and now a delay of 210 clock ticks
Thread 0: and now a delay of 224 clock ticks
Thread 1: and now a delay of 207 clock ticks
Thread 0: and now a delay of 244 clock ticks
Thread 1: and now a delay of 229 clock ticks
Thread 0: and now a delay of 243 clock ticks
Thread 1: and now a delay of 212 clock ticks

Program received signal SIGINT, Interrupt.
idle_thread_main (data=0)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:1228
1228	        idle_thread_loops[CYG_KERNEL_CPU_THIS()]++;
(gdb) deta
Ending remote debugging.
(gdb) q
/tmp/t$


Regards,
Sergei

[-- Attachment #2: gdb.txt --]
[-- Type: text/plain, Size: 4629 bytes --]

Remote debugging using /dev/ttyUSB0
0x00008028 in ?? ()
Loading section .rom_vectors, size 0x40 lma 0x81010000
Loading section .text, size 0xd6b4 lma 0x81010040
Loading section .rodata, size 0x9c0 lma 0x8101d6f4
Loading section .data, size 0x324 lma 0x8101e0b4
Start address 0x81010040, load size 58328
Transfer rate: 17 KB/sec, 299 bytes/write.
Breakpoint 1 at 0x8101af1a: file /opt/trunk/devo/ecos/packages/language/c/libc/startup/current/src/main.cxx, line 114.
Breakpoint 2 at 0x810106ac: file twothreads.c, line 43.
Continuing.
Entering twothreads' cyg_user_start() function
[Switching to Thread 3]

Breakpoint 2, simple_program (data=0) at twothreads.c:43
43	  int message = (int) data;
Current language:  auto; currently c
#0  simple_program (data=0) at twothreads.c:43
#1  0x81014052 in Cyg_HardwareThread::thread_entry (thread=0x81024768)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:94
[New Thread 1]
[New Thread 2]
[New Thread 4]
  4 Thread 4 ( Name: Thread B, State: ready, Priority: 4 )  Cyg_HardwareThread::thread_entry (thread=0x0)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:84
  3 Thread 2 ( Name: main, State: ready, Priority: 10 )  Cyg_HardwareThread::thread_entry (thread=0x0)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:84
  2 Thread 1 ( Name: Idle Thread, State: ready, Priority: 31 )  Cyg_HardwareThread::thread_entry (thread=0x0)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:84
* 1 Thread 3 ( Name: Thread A, State: running, Priority: 4 )  simple_program (
    data=0) at twothreads.c:43
43	  int message = (int) data;
44	  int delay;
45	
46	  printf("Beginning execution; thread data is %d\n", message);
47	
48	  cyg_thread_delay(200);
49	
50	  for (;;) {
51	    delay = 200 + (rand() % 50);
52	
Breakpoint 3 at 0x810106c4: file twothreads.c, line 51.
Continuing.
Beginning execution; thread data is 0
[Switching to Thread 4]

Breakpoint 2, simple_program (data=1) at twothreads.c:43
43	  int message = (int) data;
46	  printf("Beginning execution; thread data is %d\n", message);
Beginning execution; thread data is 1
48	  cyg_thread_delay(200);
Continuing.
[Switching to Thread 2]

Breakpoint 1, main (argc=1, argv=0x8102213c)
    at /opt/trunk/devo/ecos/packages/language/c/libc/startup/current/src/main.cxx:114
114	    Cyg_Thread::self()->suspend();
Current language:  auto; currently c++
[Switching to Thread 3]

Breakpoint 3, simple_program (data=0) at twothreads.c:51
51	    delay = 200 + (rand() % 50);
Current language:  auto; currently c
55	    cyg_mutex_lock(&cliblock); {
[Switching to Thread 4]

Breakpoint 3, simple_program (data=1) at twothreads.c:51
51	    delay = 200 + (rand() % 50);
Delete all breakpoints? (y or n) Continuing.
Thread 1: and now a delay of 230 clock ticks
Thread 0: and now a delay of 239 clock ticks
Thread 1: and now a delay of 221 clock ticks
Thread 0: and now a delay of 214 clock ticks
Thread 1: and now a delay of 224 clock ticks
Thread 0: and now a delay of 243 clock ticks

Program received signal SIGINT, Interrupt.
[Switching to Thread 1]
idle_thread_main (data=0)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:1228
1228	        idle_thread_loops[CYG_KERNEL_CPU_THIS()]++;
Current language:  auto; currently c++
#0  idle_thread_main (data=0)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:1228
#1  0x81014052 in Cyg_HardwareThread::thread_entry (thread=0x8101f728)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:94
  4 Thread 4 ( Name: Thread B, State: sleeping, Priority: 4 )  0x8101fff0 in Cyg_Scheduler::scheduler ()
  3 Thread 2 ( Name: main, State: suspended, Priority: 10 )  0x8101fff0 in Cyg_Scheduler::scheduler ()
* 2 Thread 1 ( Name: Idle Thread, State: running, Priority: 31 )  idle_thread_main (data=0)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:1228
  1 Thread 3 ( Name: Thread A, State: sleeping, Priority: 4 )  0x8101fff0 in Cyg_Scheduler::scheduler ()
Continuing.
Thread 1: and now a delay of 210 clock ticks
Thread 0: and now a delay of 224 clock ticks
Thread 1: and now a delay of 207 clock ticks
Thread 0: and now a delay of 244 clock ticks
Thread 1: and now a delay of 229 clock ticks
Thread 0: and now a delay of 243 clock ticks
Thread 1: and now a delay of 212 clock ticks

Program received signal SIGINT, Interrupt.
idle_thread_main (data=0)
    at /opt/trunk/devo/ecos/packages/kernel/current/src/common/thread.cxx:1228
1228	        idle_thread_loops[CYG_KERNEL_CPU_THIS()]++;
Ending remote debugging.


[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ECOS] Re: Debugging Thumb code
  2009-03-20 18:16 ` [ECOS] " Sergei Gavrikov
@ 2009-03-23  7:20   ` Sergei Gavrikov
  2009-03-23 11:01     ` John Dallaway
  0 siblings, 1 reply; 4+ messages in thread
From: Sergei Gavrikov @ 2009-03-23  7:20 UTC (permalink / raw)
  To: John Dallaway; +Cc: Ilija Kocho, eCos Discussion

[-- Attachment #1: Type: text/plain, Size: 1508 bytes --]

On Fri, Mar 20, 2009 at 06:51:05PM +0200, Sergei Gavrikov wrote:
> On Fri, Mar 20, 2009 at 02:16:59PM +0000, John Dallaway wrote:
> > Hi Ilija and Sergei
> > 
> > Many thanks for your eCos 3.0 beta 1 testing reports.
> > 
> > I wonder if you're also able to check for correct debugging of eCos
> > applications built for Thumb? Since one of you is using a big-endian ARM
> > target and the other a little-endian ARM target you can together provide
> > good coverage.
> > 
> > For avoidance of doubt:
> > 
> > a) eCos should build for Thumb on ARM architecture simply by enabling
> > CYGHWR_THUMB. I strongly recommend using a completely new build tree and
> > enabling CYGHWR_THUMB before invoking make for the first time.
> > 
> > b) The standard build of RedBoot should support debugging of both ARM
> > and Thumb applications. You do not need to rebuild RedBoot.
> > 
> > If you're able to confirm the correct operation of Thumb breakpoints,
> > single stepping and backtraces in a simple application which runs in a
> > loop such as the "twothreads" example application this would be very
> > helpful. You can build the twothreads example as follows:
> > 
> >   cd /opt/ecos/ecos-3.0b1/examples
> >   make twothreads INSTALL_DIR=/path/to/ecos-build/install
> 
> Hi John
> 
> I will be to fulfil a job and paste the below
> 
> I will place a conclusion at the line the below
> 
> ALL WORKS FOR MY TARGET

Ups. All was done for CVS trunk. I will retry all for 3.0b1.

ALL WORKS TOO. Log attached.

Sergei


[-- Attachment #2: ecos-3.0b1-arm-thumb.txt --]
[-- Type: text/plain, Size: 9639 bytes --]

~$ . /opt/ecos/ecosenv.sh 
~$ echo $ECOS_REPOSITORY 
/opt/ecos/ecos-3.0b1/packages
~$ cd /tmp
/tmp$ rm -r -f t
/tmp$ mkdir t
/tmp$ cd t
/tmp/t$ ecosconfig new olpce2294
U CYGHWR_HAL_ARM_LPC2XXX, new inferred value LPC2294
/tmp/t$ cp ecos.ecc{,.0}
/tmp/t$ vi ecos.ecc
/tmp/t$ diff -U 5 ecos.ecc.0 ecos.ecc
--- ecos.ecc.0  2009-03-20 19:08:48.000000000 +0200
+++ ecos.ecc    2009-03-20 19:09:01.000000000 +0200
@@ -2373,11 +2373,11 @@
     #     CYGINT_HAL_ARM_THUMB_ARCH == 1
     #   --> 1
 
     # Flavor: bool
     # No user value, uncomment the following line to provide one.
-    # user_value 0
+    user_value 1
     # value_source default
     # Default value: 0
 
     # The following properties are affected by this value
     # option CYGBLD_ARM_ENABLE_THUMB_INTERWORK
/tmp/t$ cp ecos.ecc{,.1}
/tmp/t$ vi ecos.ecc
/tmp/t$ diff -U 5 ecos.ecc.1 ecos.ecc
--- ecos.ecc.1	2009-03-20 19:11:02.000000000 +0200
+++ ecos.ecc	2009-03-20 19:11:15.000000000 +0200
@@ -202,11 +202,11 @@
 # flags.
 #
 cdl_option CYGBLD_GLOBAL_CFLAGS {
     # Flavor: data
     # No user value, uncomment the following line to provide one.
-    # user_value "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mthumb -mthumb-interwork -mcpu=arm7tdmi -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions"
+    user_value "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mthumb -mthumb-interwork -mcpu=arm7tdmi -g -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions"
     # value_source default
     # Default value:  CYGBLD_GLOBAL_WARNFLAGS . CYGBLD_ARCH_CFLAGS .
     #                                 "-mcpu=arm7tdmi -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" 
     #     CYGBLD_GLOBAL_WARNFLAGS == "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings "
     #     CYGBLD_ARCH_CFLAGS == "-mthumb -mthumb-interwork "
/tmp/t$ ecosconfig resolve
/tmp/t$ ecosconfig tree&&make -s
headers finished
/opt/ecos/ecos-3.0b1/packages/hal/arm/lpc2xxx/var/v3_0b1/src/hal_diag.c: In function 'cyg_hal_plf_serial_isr':
/opt/ecos/ecos-3.0b1/packages/hal/arm/lpc2xxx/var/v3_0b1/src/hal_diag.c:260: warning: pointer targets in passing argument 1 of 'cyg_hal_is_break' differ in signedness
build finished
/tmp/t$ cp -a $ECOS_REPOSITORY/../examples .
/tmp/t$ make -C examples clean INSTALL_DIR=`pwd`/installmake: Entering directory `/tmp/t/examples'
rm -f hello hello.o twothreads twothreads.o
rm -f simple-alarm simple-alarm.o serial serial.o
rm -f instrument-test instrument-test.o
make: Leaving directory `/tmp/t/examples'
/tmp/t$ make -C examples twothreads INSTALL_DIR=`pwd`/install
make: Entering directory `/tmp/t/examples'
arm-eabi-gcc -c -o twothreads.o -I/tmp/t/install/include -Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mthumb -mthumb-interwork -mcpu=arm7tdmi -g -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions twothreads.c
cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
arm-eabi-gcc -nostartfiles -L/tmp/t/install/lib -Ttarget.ld -mthumb -mthumb-interwork -mcpu=arm7tdmi -Wl,--gc-sections -Wl,-static -g -nostdlib -o twothreads twothreads.o
make: Leaving directory `/tmp/t/examples'
/tmp/t$ arm-eabi-gdb examples/twothreads
GNU gdb (eCosCentric GNU tools 4.3.2-sw) 6.8.50.20080706
Copyright (C) 2008 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 "--host=i686-pc-linux-gnu --target=arm-eabi".
For bug reporting instructions, please see:
<http://bugs.ecos.sourceware.org/>...
(gdb) set remotebaud 230400
(gdb) target remote /dev/ttyUSB0
Remote debugging using /dev/ttyUSB0
0x00008028 in ?? ()
(gdb) load
Loading section .rom_vectors, size 0x40 lma 0x81010000
Loading section .text, size 0xd6b4 lma 0x81010040
Loading section .rodata, size 0x9c0 lma 0x8101d6f4
Loading section .data, size 0x324 lma 0x8101e0b4
Start address 0x81010040, load size 58328
Transfer rate: 18 KB/sec, 299 bytes/write.
(gdb) b main
Breakpoint 1 at 0x8101af1a: file /opt/ecos/ecos-3.0b1/packages/language/c/libc/startup/v3_0b1/src/main.cxx, line 114.
(gdb) c
Continuing.
Entering twothreads' cyg_user_start() function
Beginning execution; thread data is 0
Beginning execution; thread data is 1
[Switching to Thread 2]

Breakpoint 1, main (argc=1, argv=0x8102213c)
    at /opt/ecos/ecos-3.0b1/packages/language/c/libc/startup/v3_0b1/src/main.cxx:114
114	    Cyg_Thread::self()->suspend();
(gdb) info threads 
[New Thread 1]
[New Thread 3]
[New Thread 4]
  4 Thread 4 ( Name: Thread B, State: sleeping, Priority: 4 )  0x8101fff0 in Cyg_Scheduler::scheduler ()
  3 Thread 3 ( Name: Thread A, State: sleeping, Priority: 4 )  0x8101fff0 in Cyg_Scheduler::scheduler ()
  2 Thread 1 ( Name: Idle Thread, State: ready, Priority: 31 )  Cyg_HardwareThread::thread_entry (thread=0x0)
    at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:84
* 1 Thread 2 ( Name: main, State: running, Priority: 10 )  main (argc=1, 
    argv=0x8102213c)
    at /opt/ecos/ecos-3.0b1/packages/language/c/libc/startup/v3_0b1/src/main.cxx:114
(gdb) b twothreads.c:51
Breakpoint 3 at 0x810106c4: file twothreads.c, line 51.
(gdb) c
Continuing.
[Switching to Thread 4]

Breakpoint 3, simple_program (data=1) at twothreads.c:51
51	    delay = 200 + (rand() % 50);
Current language:  auto; currently c
(gdb) bt
#0  simple_program (data=1) at twothreads.c:51
#1  0x81014052 in Cyg_HardwareThread::thread_entry (thread=0x81024810)
    at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:94
(gdb) info threads 
* 4 Thread 4 ( Name: Thread B, State: running, Priority: 4 )  simple_program (
    data=1) at twothreads.c:51
  3 Thread 3 ( Name: Thread A, State: sleeping, Priority: 4 )  0x8101fff0 in Cyg_Scheduler::scheduler ()
  2 Thread 1 ( Name: Idle Thread, State: ready, Priority: 31 )  idle_thread_main (data=0)
    at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:1228
  1 Thread 2 ( Name: main, State: suspended, Priority: 10 )  0x8101fff0 in Cyg_Scheduler::scheduler ()
(gdb) n
[Switching to Thread 3]

Breakpoint 3, simple_program (data=0) at twothreads.c:51
51	    delay = 200 + (rand() % 50);
(gdb) 
[Switching to Thread 4]
55	    cyg_mutex_lock(&cliblock); {
(gdb) 
[Switching to Thread 3]
56	      printf("Thread %d: and now a delay of %d clock ticks\n",
(gdb) 
Thread 0: and now a delay of 243 clock ticks
59	    cyg_mutex_unlock(&cliblock);
(gdb) 
60	    cyg_thread_delay(delay);
(gdb) 
Thread 1: and now a delay of 224 clock ticks
[Switching to Thread 4]

Breakpoint 3, simple_program (data=1) at twothreads.c:51
51	    delay = 200 + (rand() % 50);
(gdb) bt   
#0  simple_program (data=1) at twothreads.c:51
#1  0x81014052 in Cyg_HardwareThread::thread_entry (thread=0x81024810)
    at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:94
(gdb) info threads 
* 4 Thread 4 ( Name: Thread B, State: running, Priority: 4 )  simple_program (
    data=1) at twothreads.c:51
  3 Thread 3 ( Name: Thread A, State: sleeping, Priority: 4 )  0x8101fff0 in Cyg_Scheduler::scheduler ()
  2 Thread 1 ( Name: Idle Thread, State: ready, Priority: 31 )  idle_thread_main (data=0)
    at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:1228
  1 Thread 2 ( Name: main, State: suspended, Priority: 10 )  0x8101fff0 in Cyg_Scheduler::scheduler ()
(gdb) d
Delete all breakpoints? (y or n) y
(gdb) c
Continuing.
Thread 1: and now a delay of 210 clock ticks
Thread 0: and now a delay of 224 clock ticks
Thread 1: and now a delay of 207 clock ticks
Thread 0: and now a delay of 244 clock ticks
Thread 1: and now a delay of 229 clock ticks
Thread 0: and now a delay of 243 clock ticks
Thread 1: and now a delay of 212 clock ticks
Thread 0: and now a delay of 243 clock ticks
Thread 1: and now a delay of 247 clock ticks
Thread 0: and now a delay of 226 clock ticks
Thread 1: and now a delay of 231 clock ticks
Thread 0: and now a delay of 226 clock ticks
Thread 1: and now a delay of 224 clock ticks
Thread 0: and now a delay of 215 clock ticks
Thread 1: and now a delay of 200 clock ticks
Thread 0: and now a delay of 234 clock ticks

Program received signal SIGINT, Interrupt.
[Switching to Thread 1]
idle_thread_main (data=0)
    at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:1228
1228	        idle_thread_loops[CYG_KERNEL_CPU_THIS()]++;
Current language:  auto; currently c++
(gdb) bt
#0  idle_thread_main (data=0)
    at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:1228
#1  0x81014052 in Cyg_HardwareThread::thread_entry (thread=0x8101f728)
    at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:94
(gdb) info threads 
  4 Thread 4 ( Name: Thread B, State: sleeping, Priority: 4 )  0x8101fff0 in Cyg_Scheduler::scheduler ()
  3 Thread 3 ( Name: Thread A, State: sleeping, Priority: 4 )  0x8101fff0 in Cyg_Scheduler::scheduler ()
* 2 Thread 1 ( Name: Idle Thread, State: running, Priority: 31 )  idle_thread_main (data=0)
    at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:1228
  1 Thread 2 ( Name: main, State: suspended, Priority: 10 )  0x8101fff0 in Cyg_Scheduler::scheduler ()
(gdb) deta
Ending remote debugging.
(gdb) q
tmp/t$ 


[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ECOS] Re: Debugging Thumb code
  2009-03-23  7:20   ` Sergei Gavrikov
@ 2009-03-23 11:01     ` John Dallaway
  0 siblings, 0 replies; 4+ messages in thread
From: John Dallaway @ 2009-03-23 11:01 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: eCos Discussion

Hi Sergei

Sergei Gavrikov wrote:

>> I will be to fulfil a job and paste the below
>>
>> I will place a conclusion at the line the below
>>
>> ALL WORKS FOR MY TARGET
> 
> Ups. All was done for CVS trunk. I will retry all for 3.0b1.
> 
> ALL WORKS TOO. Log attached.

Excellent! Many thanks for your help, Sergei. The final release is
getting closer...

John Dallaway
eCos 3.0 release manager

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-03-23  9:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-20 15:18 [ECOS] Debugging Thumb code John Dallaway
2009-03-20 18:16 ` [ECOS] " Sergei Gavrikov
2009-03-23  7:20   ` Sergei Gavrikov
2009-03-23 11:01     ` John Dallaway

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).