[#4573] kgdb through uart writing to l1 get wrong number
Submitted By: Mingquan Pan
Open Date
2008-10-29 22:14:46 Close Date
2008-12-03 05:53:30
Priority:
Medium Assignee:
Sonic Zhang
Status:
Closed Fixed In Release:
N/A
Found In Release:
N/A Release:
Category:
N/A Board:
N/A
Processor:
N/A Silicon Revision:
Is this bug repeatable?:
Yes Resolution:
Rejected
Uboot version or rev.:
Toolchain version or rev.:
Oct 10
App binary format:
N/A
Summary: kgdb through uart writing to l1 get wrong number
Details:
kgdb through uart writing to l1 get wrong number.
kgdb_test.c do num1=num1+10 in l1, however, when debugging through uart port, num1 would remain 10 after the second round.
The log is:
Loading .text @ 0x00001000 (1107472 bytes)
Loading .rodata @ 0x0010f620 (279016 bytes)
Loading __ksymtab @ 0x00153808 (15488 bytes)
Loading __ksymtab_gpl @ 0x00157488 (4688 bytes)
Loading __ksymtab_strings @ 0x001586d8 (44782 bytes)
Loading __param @ 0x001635c8 (340 bytes)
Clearing .bss @ 0x00163720 (85104 bytes)
Loading .data @ 0x00178390 (64624 bytes)
Loading .init.text @ 0x00188000 (101320 bytes)
Loading .init.data @ 0x001a0bc8 (13620 bytes)
Loading .init.setup @ 0x001a40fc (700 bytes)
Loading .initcall.init @ 0x001a43b8 (496 bytes)
Loading .con_initcall.init @ 0x001a45a8 (4 bytes)
Loading .init.ramfs @ 0x001a45ac (3128340 bytes)
Loading .text_l1 @ 0xffa00000 (7256 bytes)
sh_addr: FFA00000, p_paddr: 004A01C0
Loading from: 0248D000 to 004A01C0, size: 7256
Loading .data_l1 @ 0xff800000 (224 bytes)
sh_addr: FF800000, p_paddr: 004A1E18
Loading from: 0248F000 to 004A1E18, size: 224
## Starting application at 0x001962c0 ...
Linux version 2.6.26.5-ADI-2009R1-pre-svn5497-dirty (test@uclinux50-bf537-ad9960-ad1836) (gcc version 4.1.2 (ADI svn)) #5 Wed Oct 29 13:59:12 CST 2008
Warning: limiting memory to 56MB due to hardware anomaly 05000263
Board Memory: 64MB
Kernel Managed Memory: 64MB
Memory map:
fixedcode = 0x00000400-0x00000490
text = 0x00001000-0x0010f610
rodata = 0x0010f620-0x0016371c
bss = 0x00163720-0x00178390
data = 0x00178390-0x00188000
stack = 0x00186000-0x00188000
init = 0x00188000-0x004a2000
available = 0x004a2000-0x037ff000
DMA Zone = 0x03f00000-0x04000000
Hardware Trace Active and Enabled
Reset caused by Software reset
Blackfin support (C) 2004-2008 Analog Devices, Inc.
Compiled for ADSP-BF537 Rev 0.2
Blackfin Linux support by blackfin.uclinux.org/
Processor Speed: 500 MHz core clock and 100 MHz System Clock
NOMPU: setting up cplb tables for global access
Instruction Cache Enabled
Data Cache Enabled (write-through)
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 14223
Kernel command line: console=ttyBF0,57600 kgdboc=ttyBF1,57600n8
Configuring Blackfin Priority Driven Interrupts
PID hash table entries: 256 (order: 8, 1024 bytes)
console [ttyBF0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory available: 52016k/65536k RAM, (3176k init code, 1081k kernel code, 483k data, 1024k dma, 7756k reserved)
Security Framework initialized
Mount-cache hash table entries: 512
Blackfin Scratchpad data SRAM: 4 KB
Blackfin L1 Data A SRAM: 16 KB (15 KB free)
Blackfin L1 Data B SRAM: 16 KB (16 KB free)
Blackfin L1 Instruction SRAM: 48 KB (40 KB free)
net_namespace: 192 bytes
NET: Registered protocol family 16
Blackfin GPIO Controller
Blackfin DMA Controller
stamp_init(): registering device resources
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
msgmni has been set to 101
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler cfq registered
Serial: Blackfin serial driver
bfin-uart.1: ttyBF0 at MMIO 0xffc00400 (irq = 18) is a BFIN-UART
bfin-uart.1: ttyBF1 at MMIO 0xffc02000 (irq = 20) is a BFIN-UART
kgdb: Registered I/O driver kgdboc.
brd: module loaded
bfin_mac_mdio: probed
bfin_mac: attached PHY driver [SMSC LAN83C185] (mii_bus:phy_addr=0:01, irq=-1, mdc_clk=2500000Hz(mdc_div=19)@sclk=100MHz)
bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1
bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500, dma channel@7
rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0
TCP cubic registered
NET: Registered protocol family 17
rtc-bfin rtc-bfin: setting system clock to 1970-01-01 00:38:28 UTC (2308)
Freeing unused kernel memory: 3176k freed
_____________________________________
a8888b. / Welcome to the uClinux distribution \
d888888b. / _ _ \
8P"YP"Y88 / | | |_| __ __ (TM) |
8|o||o|88 _____/ | | _ ____ _ _ \ \/ / |
8' .88 \ | | | | _ \| | | | \ / |
8`._.' Y8. \ | |__ | | | | | |_| | / \ |
d/ `8b. \ \____||_|_| |_|\____|/_/\_\ |
dP . Y8b. \ For embedded processors including |
d8:' " `::88b \ the Analog Devices Blackfin /
d8" 'Y88b \___________________________________/
:8P ' :888
8a. : _a88P For further information, check out:
._/"Yaa_: .| 88P| - blackfin.uclinux.org/
\ YP" `| 8P `. - docs.blackfin.uclinux.org/
/ \.___.d| .' - www.uclinux.org/
`--..__)8888P`._.' jgs/a:f - www.analog.com/blackfin
Have a lot of fun...
BusyBox v1.12.1 (2008-10-29 11:24:37 CST) built-in shell (msh)
Enter 'help' for a list of built-in commands.
root:/>
#### Debugging is through uart port.
************** STEP 3: Start KGDB TEST
ifconfig eth0 10.100.4.50
root:/> PHY: 0:01 - Link is Up - 100/Full
脗SysRq : GDB
Entering KGDB
Prepare KGDB through uart port debug!spawn bfin-uclinux-gdb /tftpboot/vmlinux
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=bfin-uclinux"...
(gdb)
Case 1 ...PASS
Case 1 ...PASS
set remotebaud 57600
(gdb)
Case 2 ...PASS
Case 2 ...PASS
target remote /dev/ttyUSB0
Remote debugging using /dev/ttyUSB0
kgdb_breakpoint () at kernel/kgdb.c:1675
Case 2 ...PASS
Case 2 ...PASS
1675 atomic_set(&kgdb_setting_breakpoint, 0);
(gdb) break kgdb_test
Breakpoint 1 at 0x8c16: file arch/blackfin/kernel/kgdb_test.c, line 77.
Case 3 ...PASS
Case 3 ...PASS
(gdb) c
Continuing.
Case 4 ...PASS
Case 4 ...PASS
B: not found
root:/> [New Thread 148]
[Switching to Thread 148]
Breakpoint 1, kgdb_test (name=<value optimized out>, len=<value optimized out>, count=<value optimized out>, z=16) at arch/blackfin/kernel/kgdb_test.c:77
Case 5 ...PASS
Case 5 ...PASS
77 arch/blackfin/kernel/kgdb_test.c: No such file or directory.
in arch/blackfin/kernel/kgdb_test.c
(gdb) hbreak 80
Hardware assisted breakpoint 2 at 0x8c34: file arch/blackfin/kernel/kgdb_test.c, line 80.
(gdb)
Case 6 ...PASS
Case 6 ...PASS
info b
Num Type Disp Enb Address What
1 breakpoint keep y 0x00008c16 in kgdb_test at arch/blackfin/kernel/kgdb_test.c:77
breakpoint already hit 1 time
2 hw breakpoint keep y 0x00008c34 in kgdb_test at arch/blackfin/kernel/kgdb_test.c:80
Case 7 ...PASS
Case 7 ...PASS
(gdb) list
72 in arch/blackfin/kernel/kgdb_test.c
(gdb)
Case 8 ...PASS
Case 8 ...PASS
bt
#0 kgdb_test (name=<value optimized out>, len=<value optimized out>, count=<value optimized out>, z=16) at arch/blackfin/kernel/kgdb_test.c:77
Case 9 ...PASS
Case 9 ...PASS
#1 0x00008c5a in test_proc_output (buf=<value optimized out>) at arch/blackfin/kernel/kgdb_test.c:85
#2 0x00008c7e in test_read_proc (page=0x1eb000 "", start=0x3179e64, off=0, count=3072, eof=0x3179e68, data=0x0) at arch/blackfin/kernel/kgdb_test.c:98
#3 0x0007297e in proc_file_read (file=<value optimized out>, buf=0x2e7e90 "", nbytes=4096, ppos=0x3179eec) at fs/proc/generic.c:120
#4 0x0006ecf8 in proc_reg_read (file=<value optimized out>, buf=<value optimized out>, count=<value optimized out>, ppos=0x3179eec)
at fs/proc/inode.c:189
#5 0x0004439a in vfs_read (file=0x3091ac0, buf=0x2e7e90 "", count=4096, pos=0x3179eec) at fs/read_write.c:273
#6 0x000446e6 in sys_read (fd=<value optimized out>, buf=<value optimized out>, count=4096) at fs/read_write.c:362
#7 0xffa00984 in system_call () at include/linux/rcuclassic.h:105
(gdb) c
Continuing.
cat /proc/kgdbtest
kgdb name(12): hello world!, 85, 16
Case 10 ...PASS
Case 10 ...PASS
Breakpoint 2, kgdb_test (name=<value optimized out>, len=<value optimized out>, count=<value optimized out>, z=16) at arch/blackfin/kernel/kgdb_test.c:81
81 in arch/blackfin/kernel/kgdb_test.c
Case 11 ...PASS
Case 11 ...PASS
(gdb) print z
$1 = 16
Case 12 ...PASS
Case 12 ...PASS
(gdb) c
Continuing.
L1(before change) : data variable addr = 0xff800010, data value is 0
L1 : code function addr = 0xffa003ac
L1(after change) : data variable addr = 0xff800010, data val
Case 12 ...PASS
Case 12 ...PASS
[New Thread 149]
[Switching to Thread 149]
Breakpoint 1, kgdb_test (name=<value optimized out>, len=<value optimized out>, count=<value optimized out>, z=16) at arch/blackfin/kernel/kgdb_test.c:77
77 in arch/blackfin/kernel/kgdb_test.c
(gdb) break kgdb_l1_test
Breakpoint 3 at 0xffa003ae: file arch/blackfin/kernel/kgdb_test.c, line 53.
(gdb) break 57
Breakpoint 4 at 0xffa003f2: file arch/blackfin/kernel/kgdb_test.c, line 57.
(gdb) c
Continuing.
Breakpoint 2, kgdb_test (name=<value optimized out>, len=<value optimized out>, count=<value optimized out>, z=16) at arch/blackfin/kernel/kgdb_test.c:81
81 in arch/blackfin/kernel/kgdb_test.c
(gdb) ue is 10
root:/> cat /proc/kgdbtest
kgdb name(12): hello world!, 85, 16
Case 14 ...PASS
Case 14 ...PASS
c
Continuing.
Breakpoint 3, kgdb_l1_test () at arch/blackfin/kernel/kgdb_test.c:53
53 in arch/blackfin/kernel/kgdb_test.c
(gdb) print num1
$2 = 10
Case 15 ...PASS
Case 15 ...PASS
(gdb) c
Continuing.
Breakpoint 4, kgdb_l1_test () at arch/blackfin/kernel/kgdb_test.c:58
58 in arch/blackfin/kernel/kgdb_test.c
(gdb) print num1
$3 = 10
(gdb) spawn /bin/sh
uclinux50-bf537-ad9960-ad1836:~/work/cruise/checkouts/uclinux-dist/testsuites/kgdb> ps aux | grep bfin-uclinux-gdb
test 6256 0.8 5.4 32464 27316 pts/8 Ss+ 18:41 0:00 bfin-uclinux-gdb /tftpboot/vmlinux
uclinux50-bf537-ad9960-ad1836:~/work/cruise/checkouts/uclinux-dist/testsuites/kgdb> kill -9 `pidof bfin-uclinux-gdb`
uclinux50-bf537-ad9960-ad1836:~/work/cruise/checkouts/uclinux-dist/testsuites/kgdb>
Case 16 ...FAIL
Case 16 ...FAIL
And after that running :cat /proc/kgdbtest on target would get some random number:
root:/> cat /proc/kgdbtest
kgdb name(12): hello world!, 85, 16
L1(before change) : data variable addr = 0x03780010, data value is 795764860
L1 : code function addr = 0xffa003ac
L1(after change) : data variable addr = 0x03780010, data value is 795764870
kgdb name(12): hello world!, 85, 16
L1(before change) : data variable addr = 0x03780010, data value is 795764870
L1 : code function addr = 0xffa003ac
L1(after change) : data variable addr = 0x03780010, data value is 795764880
Follow-ups
--- Sonic Zhang 2008-11-10 23:14:40
Can't replicate by following steps:
p/x num1
0x0
set num1 = 0x50
c
Ctrl+c
p/x num1
0x50
c
cat proc/kgdb_test
Ctrl+c
p/x num1
0x5a
--- Mingquan Pan 2008-12-03 05:53:30
Yeah, it should be the breakpoint stop twice issue results in this test script
running chaos and has this error. Actually this operation is right.Close.
Files
Changes
Commits
Dependencies
Duplicates
Associations
Tags
File Name File Type File Size Posted By
No Files Were Found