[ECOS] printf does not work in user mode on Arm E7T

Pierre Habraken Pierre.Habraken@imag.fr
Wed Apr 2 12:40:00 GMT 2003


Jonathan Larmour wrote:
> [...]
> Use "set debug remote 1" in GDB and try and find out if anything is
> not right in the traffic there.

I attach below a trace of a gdb session.
At some place, gdb says:
"Packet Z0 (software-breakpoint) is NOT supported".
Is this Ok ? I am not sure of that because the Arm processor does have a
breakpoint instruction (BKPT)...
The log confirms that the 'step' command which should enter the function
dummy() gets no reply from the target.


> Finally, there's arm/arch's arm_stub.c which contains code to
> determine the next PC on a single step. That's definitely worth
> a look given your problem, although the odd thing is how this works
> for others, but maybe something changed a while back and no-one's
> noticed yet! I don't have an arm target here to test I'm afraid.

I had a (very) quick look yesterday to arm_stub.c and saw nothing weird
concerning either computing of next PC for the BL instruction or special
processing related to the processor mode (user or supervisor). BTW, no
constant value is defined in hal_arch.h for the user mode...

Pierre

===============================================================
$ arm-elf-gdb
GNU gdb 5.3
...
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-elf".
(gdb) set remotebaud 38400
(gdb) file test-printf
Reading symbols from test-printf...done.
(gdb) target remote /dev/ttyS0
Remote debugging using /dev/ttyS0
0x01822ccc in ?? ()
(gdb) load
Loading section .text, size 0x8d80 lma 0x10000
Loading section .init, size 0x1c lma 0x18d80
Loading section .fini, size 0x18 lma 0x18d9c
Loading section .rodata, size 0x318 lma 0x18db4
Loading section .data, size 0x7ec lma 0x191cc
Loading section .eh_frame, size 0x4 lma 0x199b8
Loading section .ctors, size 0x8 lma 0x199bc
Loading section .dtors, size 0x8 lma 0x199c4
Loading section .jcr, size 0x4 lma 0x199cc
Start address 0x10100, load size 39120
Transfer rate: 26080 bits/sec, 291 bytes/write.
(gdb) list test-printf.c:12
7       int main()
8       {
9          int i;
10
11         i = dummy();       // can step in dummy()
12         printf("%d\n", i); // printf OK
13
14         toUsr();           // switch to user mode
15
16         i = dummy() + 1;   // can NOT step in dummy()
(gdb) break 16
Breakpoint 1 at 0x1060c: file test-printf.c, line 16.
(gdb) set debug remote 1
(gdb) cont
Continuing.
Sending packet: $Z0,1060c,4#40...Ack
Packet received:
Packet Z0 (software-breakpoint) is NOT supported
Sending packet: $m1060c,4#f7...Ack
Packet received: ecffffeb
Sending packet: $X1060c,4:þÞÿç#de...Ack
Packet received: OK
Sending packet: $Hc0#db...Ack
Packet received: OK
Sending packet: $c#63...Ack
Packet received: O343636300A
4660
Packet received: T050f:0c060100;0d:ccff0700;
Sending packet: $g#67...Ack
Packet received:
1000000001000000009a01008908000002000000500000000000000000000000e0970000fdffffff50000000dcff0700a8030100ccff07000c0601000c0601000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000
Sending packet: $m105e0,4#f8...Ack
Packet received: 0dc0a0e1
Sending packet: $m105e4,4#fc...Ack
Packet received: 00d82de9
Sending packet: $m105e8,4#00...Ack
Packet received: 04b04ce2
Sending packet: $m105ec,4#2b...Ack
Packet received: 04d04de2
Sending packet: $m105f0,4#f9...Ack
Packet received: f3ffffeb
Sending packet: $m105f4,4#fd...Ack
Packet received: 0030a0e1
Sending packet: $m105f8,4#01...Ack
Packet received: 10300be5
Sending packet: $m105fc,4#2c...Ack
Packet received: 2c009fe5
Sending packet: $m10600,4#c4...Ack
Packet received: 10101be5
Sending packet: $m10604,4#c8...Ack
Packet received: 670000eb
Sending packet: $m10608,4#cc...Ack
Packet received: e7ffffeb
Sending packet: $m1060c,4#f7...Ack
Packet received: fedeffe7
Sending packet: $m10610,4#c5...Ack
Packet received: 0030a0e1
Sending packet: $m10614,4#c9...Ack
Packet received: 013083e2
Sending packet: $m10618,4#cd...Ack
Packet received: 10300be5
Sending packet: $m1061c,4#f8...Ack
Packet received: 0c009fe5
Sending packet: $X1060c,4:ìÿÿë#f1...Ack
Packet received: OK

Breakpoint 1, main () at test-printf.c:16
16         i = dummy() + 1;   // can NOT step in dummy()
(gdb) step
Sending packet: $Hc0#db...Ack
Packet received: OK
Sending packet: $s#73...Ack
remote_interrupt called
remote_stop called
Interrupted while waiting for the program.
Give up (and stop debugging it)? (y or n) y
(gdb)
===============================================================
-- 
________________________________________________________________________
Pierre HABRAKEN - mailto:Pierre.Habraken@imag.fr
Tél: 04 76 82 72 83 - Fax: 04 76 82 72 87
IMAG-LSR BP72 38402 SAINT MARTIN D'HERES Cedex
________________________________________________________________________

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



More information about the Ecos-discuss mailing list