[#4835] set kgdb hardware breakpoint when testing through uart would have error
Submitted By: Mingquan Pan
Open Date
2009-01-22 03:37:01 Close Date
2009-03-02 05:42:49
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:
BF537 Silicon Revision:
Is this bug repeatable?:
Yes Resolution:
Duplicate
Uboot version or rev.:
Toolchain version or rev.:
Jan 17,2009
App binary format:
N/A
Summary: set kgdb hardware breakpoint when testing through uart would have error
Details:
set kgdb hardware breakpoint when testing through uart would have error.
## Booting image at 02000000 ...
Image Name: Linux-2.6.28-ADI-2009R1-pre-svn6
Created: 2009-01-20 3:50:26 UTC
Image Type: Blackfin Linux Kernel Image (gzip compressed)
Data Size: 4076248 Bytes = 3.9 MB
Load Address: 00001000
Entry Point: 001923ec
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Starting Kernel at = 1923ec
Linux version 2.6.28-ADI-2009R1-pre-svn6027 (test@uclinux50-bf537-ad9960-ad1836) (gcc version 4.1.2 (ADI svn)) #18 Tue Jan 20 11:50:03 CST 2009
Warning: limiting memory to 56MB due to hardware anomaly 05000263
Board Memory: 64MB
Kernel Managed Memory: 64MB
Memory map:
fixedcode = 0x00000400-0x00000490
text = 0x00001000-0x0010cd00
rodata = 0x0010cd00-0x0015fc3c
bss = 0x0015fc40-0x00173fac
data = 0x00173fac-0x00184000
stack = 0x00182000-0x00184000
init = 0x00184000-0x007b3000
available = 0x007b3000-0x037ff000
DMA Zone = 0x03f00000-0x04000000
Hardware Trace Active and Enabled
Boot Mode: 0
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
Instruction Cache Enabled for CPU0
Data Cache Enabled for CPU0 (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: 48876k/65536k RAM, (6332k init code, 1071k kernel code, 477k data, 1024k dma, 7756k reserved)
Calibrating delay loop... 995.32 BogoMIPS (lpj=1990656)
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 (41 KB free)
PDA for CPU0 reserved at 00160e70
net_namespace: 288 bytes
NET: Registered protocol family 16
Blackfin GPIO Controller
Blackfin DMA Controller
stamp_init(): registering device resources
Hardware Trace:
0 Target : <0x0000491c> { _dump_stack + 0x0 }
Source : <0x000066a8> { _bfin_gpio_request + 0xf4 } CALL pcrel
1 Target : <0x000066a8> { _bfin_gpio_request + 0xf4 }
Source : <0x0000661c> { _bfin_gpio_request + 0x68 } IF !CC JUMP
2 Target : <0x000065ee> { _bfin_gpio_request + 0x3a }
Source : <0x000065d0> { _bfin_gpio_request + 0x1c } IF !CC JUMP
3 Target : <0x000065ce> { _bfin_gpio_request + 0x1a }
Source : <0x000060c4> { _cmp_label + 0x30 } RTS
4 Target : <0x000060bc> { _cmp_label + 0x28 }
Source : <0x000060b4> { _cmp_label + 0x20 } IF !CC JUMP
5 Target : <0x000060ae> { _cmp_label + 0x1a }
Source : <0x000060b8> { _cmp_label + 0x24 } IF CC JUMP
6 Target : <0x000060ae> { _cmp_label + 0x1a }
Source : <0x000060b8> { _cmp_label + 0x24 } IF CC JUMP
7 Target : <0x000060ae> { _cmp_label + 0x1a }
Source : <0x000060b8> { _cmp_label + 0x24 } IF CC JUMP
8 Target : <0x000060ae> { _cmp_label + 0x1a }
Source : <0x000060b8> { _cmp_label + 0x24 } IF CC JUMP
9 Target : <0x00006094> { _cmp_label + 0x0 }
Source : <0x000065ca> { _bfin_gpio_request + 0x16 } CALL pcrel
10 Target : <0x000065b4> { _bfin_gpio_request + 0x0 }
Source : <0x001927aa> { _stamp_init + 0x32 } CALL pcrel
11 Target : <0x001927a0> { _stamp_init + 0x28 }
Source : <0x001992f8> { _i2c_register_board_info + 0x9c } RTS
12 Target : <0x001992f0> { _i2c_register_board_info + 0x94 }
Source : <0x0010be32> { _mutex_unlock + 0x22 } RTS
13 Target : <0x0010be10> { _mutex_unlock + 0x0 }
Source : <0x001992ec> { _i2c_register_board_info + 0x90 } CALL pcrel
14 Target : <0x001992e2> { _i2c_register_board_info + 0x86 }
Source : <0x001992c6> { _i2c_register_board_info + 0x6a } IF !CC JUMP
15 Target : <0x001992a0> { _i2c_register_board_info + 0x44 }
Source : <0x001992dc> { _i2c_register_board_info + 0x80 } IF CC JUMP
Stack info:
SP: [0x037e1e1c] <0x037e1e1c> /* kernel dynamic memory */
FP: (0x037e1e34)
Memory from 0x037e1e10 to 037e2000
037e1e10: 00000000 037e1e1c <0010beb4>[001992d8]<000066ac> 00000000 00000003 00000000
037e1e30: 001a06b4 (00000000)<001927ae> 0015fc64 00192778 001a06b4 00000000 00000000
037e1e50: 00000000 00000000 0018a928 0010d8dc 00000001 <00001028> 00181bf0 037fd220
037e1e70: 037e0000 000040d0 00000000 00000001 000240d0 00000000 00000000 00181bf0
037e1e90: 00000001 00000044 037e0000 037e0000 037e0000 000240d0 037e0000 00000010
037e1eb0: 007c8b60 00000000 00000000 00000000 00000000 00000000 00000000 00000000
037e1ed0: 00000000 ffffffff 037e1f08 <0008ae0e> 00179a88 0016f054 0016fb5c <0008ae82>
037e1ef0: 037fb6a4 00000000 000000d2 0016fb5c 000000d0 037e1f08 037e8e10 00000000
037e1f10: 00000000 001a06b4 <0008afe6> 0016fb5c 0016f054 00000000 <00070158> 00179a88
037e1f30: 0016f054 001a06b4 037e1f5c 0085b4a0 0085a300 00000000 00000000 0016fb5c
037e1f50: 037e1f5c <001420f8><00070374> 000000d2 <00070382> 00179a88 0085b4a0 00004000
037e1f70: 00000000 00000000 037e1f9c 7fffff00 00000001 <00031e6e> 037e1f9c 00000061
037e1f90:<00070446> 001a0474 0085a300 00003739 00000000 00190000 <00031eca> 001783c8
037e1fb0: 001a0474 00000061 00179a88 <001843b0> 001a04c8 001a0474 00000000 00000000
037e1fd0: 00000000 00000000 00000000 00000000 00000000 <0000145e> 00000000 00000000
037e1ff0: 00000000 00000000 ffffffff 00000006 037f74a0
Return addresses in stack:
address : <0x0010beb4> { _mutex_lock + 0xc }
address : <0x001992d8> { _i2c_register_board_info + 0x7c }
address : <0x000066ac> { _bfin_gpio_request + 0xf8 }
frame 1 : <0x001927ae> { _stamp_init + 0x36 }
address : <0x00001028> { _do_one_initcall + 0x28 }
address : <0x0008ae0e> { _ida_get_new_above + 0x96 }
address : <0x0008ae82> { _ida_get_new_above + 0x10a }
address : <0x0008afe6> { _ida_pre_get + 0xe }
address : <0x00070158> { _proc_register + 0x30 }
address : <0x001420f8> /* kernel dynamic memory */
address : <0x00070374> { _create_proc_entry + 0x3c }
address : <0x00070382> { _create_proc_entry + 0x4a }
address : <0x00031e6e> { _register_irq_proc + 0x76 }
address : <0x00070446> { _proc_mkdir_mode + 0x2e }
address : <0x00031eca> { _init_irq_proc + 0x42 }
address : <0x001843b0> { _kernel_init + 0x84 }
address : <0x0000145e> { _kernel_thread_helper + 0x6 }
bfin-gpio: GPIO 3 is already reserved as Peripheral by bfin-uart !
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 95
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 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 1971-10-09 19:40:28 UTC (55885228)
Freeing unused kernel memory: 6332k 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.13.2 (2009-01-20 08:05:31 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 /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/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:1722
Case 2 ...PASS
Case 2 ...PASS
1722 atomic_set(&kgdb_setting_breakpoint, 0);
(gdb) break kgdb_test
Breakpoint 1 at 0x86ae: file arch/blackfin/kernel/kgdb_test.c, line 54.
Case 3 ...PASS
Case 3 ...PASS
(gdb) c
Continuing.
Case 4 ...PASS
Case 4 ...PASS
B: not found
root:/> [New Thread 159]
[Switching to Thread 159]
Breakpoint 1, kgdb_test (name=0x8700 "J谩聽每\n谩\220\003b", len=1103916,
Case 5 ...PASS
Case 5 ...PASS
count=12, z=85) at arch/blackfin/kernel/kgdb_test.c:54
54 printk(KERN_DEBUG "kgdb name(%d): %s, %d, %d\n", len, name, count, z);
(gdb) hbreak 56
Hardware assisted breakpoint 2 at 0x86d4: file arch/blackfin/kernel/kgdb_test.c, line 56.
(gdb)
Case 6 ...PASS
Case 6 ...PASS
info b
Num Type Disp Enb Address What
1 breakpoint keep y 0x000086ae in kgdb_test
at arch/blackfin/kernel/kgdb_test.c:54
breakpoint already hit 1 time
2 hw breakpoint keep y 0x000086d4 in kgdb_test
Case 7 ...PASS
Case 7 ...PASS
at arch/blackfin/kernel/kgdb_test.c:56
(gdb) list
49 #endif
50
51
52 int kgdb_test(char *name, int len, int count, int z)
53 {
54 printk(KERN_DEBUG "kgdb name(%d): %s, %d, %d\n", len, name, count, z);
55 count = z;
56 return count;
57 }
58
(gdb)
Case 8 ...PASS
Case 8 ...PASS
bt
#0 kgdb_test (name=0x8700 "J谩聽每\n谩\220\003b", len=1103916, count=12, z=85)
at arch/blackfin/kernel/kgdb_test.c:54
Case 9 ...PASS
Case 9 ...PASS
#1 0x00001000 in ?? ()
#2 0x00008700 in test_proc_output (buf=0x0)
at arch/blackfin/kernel/kgdb_test.c:61
#3 0x00000000 in ?? ()
(gdb) c
Continuing.
cat /proc/kgdbtest
L1(before change) : data variable addr = 0xff800000, data value is 0
L1 : code function addr = 0xffa00390
L1(after change) : data variable addr = 0xff800000, data value is 10
NULL pointer access
Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) spawn /bin/sh
db> ps aux | grep bfin-uclinux-gdbrk/cruise/checkouts/uclinux-dist/testsuites/kgd
test 19295 1.0 5.2 31340 26392 pts/4 Ss+ 11:51 0:00 bfin-uclinux-gdb /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/vmlinux
test 19308 0.0 0.1 3064 732 pts/5 S+ 11:52 0:00 grep bfin-uclinux-gdb
db> kill -9 `pidof bfin-uclinux-gdb`cruise/checkouts/uclinux-dist/testsuites/kgd
db> nux50-bf537-ad9960-ad1836:~/work/cruise/checkouts/uclinux-dist/testsuites/kgd
Case 11 ...FAIL
It is expected to stop at hbreakpoint2 56, but slip over it.
Follow-ups
--- Sonic Zhang 2009-02-03 23:23:09
Can't replicate.
--- Sonic Zhang 2009-02-03 23:25:44
(gdb)
Case 8 ...PASS
bt
#0 kgdb_test (name=0x1112c8 "hello world!", len=12, count=85, z=16)
at arch/blackfin/kernel/kgdb_test.c:54
Case 9 ...PASS
#1 0x00008984 in test_proc_output (buf=0x838000 "") at
arch/blackfin/kernel/kgdb_test.c:61
#2 0x000089ae in test_read_proc (page=0x838000 "", start=0x835e64,
off=0, count=3072,
eof=0x835e68, data=0x0) at arch/blackfin/kernel/kgdb_test.c:75
#3 0x00071c2c in proc_file_read (file=<value optimized out>,
buf=0x3e8e90 "", nbytes=4096,
ppos=0x835eec) at fs/proc/generic.c:120
#4 0x0006e0a0 in proc_reg_read (file=<value optimized out>,
buf=<value optimized out>,
count=<value optimized out>, ppos=0x835eec) at fs/proc/inode.c:191
#5 0x000442cc in vfs_read (file=0x30a9b60, buf=0x3e8e90 "",
count=4096, pos=0x835eec)
at fs/read_write.c:279
#6 0x00044504 in sys_read (fd=<value optimized out>, buf=<value
optimized out>, count=4096)
at fs/read_write.c:368
#7 0xffa008dc in system_call () at include/linux/rcuclassic.h:122
(gdb) c
Continuing.
cat /proc/kgdbtest
<7>kgdb name(12): hello world!, 85, 16
Case 10 ...PASS
Breakpoint 2, kgdb_test (name=0x1112c8 "hello world!", len=12,
count=16, z=16)
at arch/blackfin/kernel/kgdb_test.c:56
56 return count;
Case 11 ...PASS
(gdb) print z
$1 = 16
Case 12 ...PASS
(gdb) c
Continuing.
L1(before change) : data variable addr = 0xff800000, data value is 0
L1 : code function addr = 0xffa003a4
L1(after change) : data variable addr = 0xff800000, data value is 10
Case 12 ...PASS
--- Mingquan Pan 2009-02-16 23:13:55
This bug should be happening again on trunk head from about Feb 10. And probably
duplicated with bug [4911].
Files
Changes
Commits
Dependencies
Duplicates
Associations
Tags
File Name File Type File Size Posted By
No Files Were Found