当前位置: 技术问答>linux和unix
使用GDBSERVER报错
来源: 互联网 发布时间:2016-11-03
本文导语: Sourcery_G++_Lite 2009.q3版 4.3.3 在虚拟机上写了一个helloworld程序, 用它的交叉编译器编译, 可以在目标板运行, 把它的gdbserver和 helloworld拷贝到目标板 看资料都是先在目标板上运行gdbserver, 然后在虚拟机上运行gdb进...
Sourcery_G++_Lite 2009.q3版 4.3.3
在虚拟机上写了一个helloworld程序, 用它的交叉编译器编译, 可以在目标板运行,
把它的gdbserver和 helloworld拷贝到目标板
看资料都是先在目标板上运行gdbserver, 然后在虚拟机上运行gdb进行调试
于是在开发板上我敲
gdbserver "PC的IP":1234 HELLOWORLD
此时报很多错, 最后helloworld居然还执行了起来, 按我的理解, 这里只是服务器, 运行应该在pC上才是啊
附:出错信息
Process /root/a.out created; pid = 535
Internal error: Oops - undefined instruction: 0 [#2] PREEMPT
last sysfs file: /sys/devices/virtual/vc/vcsa6/dev
Modules linked in:
CPU: 0 Tainted: G D (2.6.33-rc4 #13)
PC is at vfp_sync_state+0x24/0x88
LR is at arch_ptrace+0x3c0/0x49c
pc : [] lr : [] psr: 80000013
sp : c7bc9ef8 ip : c7bc9f18 fp : c7bc9f14
r10: 00000001 r9 : c7bc8000 r8 : 00000000
r7 : 0002f2d0 r6 : 0000001b r5 : 0002f2d0 r4 : c7bc4000
r3 : 00000002 r2 : c7bc8000 r1 : 0000001a r0 : c7bc4000
Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 0005317f Table: c7b38000 DAC: 00000015
Process gdbserver (pid: 532, stack limit = 0xc7bc8270)
Stack: (0xc7bc9ef8 to 0xc7bca000)
9ee0: c7bc4000 0002f2d0
9f00: 0000001b 0002f2d0 c7bc9f7c c7bc9f18 c00776b8 c0082564 c7bc9f54 c7bc9f28
9f20: c00f37d4 c010b510 00000000 00000000 c7bc7680 00000000 c79fca80 c7bc7680
9f40: c00760a4 00000008 c7bc9f64 00000217 c7bc9f6c c7bc9f60 c00a289c c00a2850
9f60: c7bc9f7c c786a640 00000000 0000001b c7bc9fa4 c7bc9f80 c0098b90 c0077308
9f80: 0000001b 0002458c 00000000 0000001a c00760a4 c7bc8000 00000000 c7bc9fa8
9fa0: c0075f20 c0098a94 0000001b 0002458c 0000001b 00000217 00000000 0002f2d0
9fc0: 0000001b 0002458c 00000000 0000001a 0002f2d0 0002455c 00000001 00026664
9fe0: 0000001b bec2da00 00014aac 40107c74 20000010 0000001b 00000000 00000000
Backtrace:
[] (vfp_sync_state+0x0/0x88) from [] (arch_ptrace+0x3c0/0x49
c)
r7:0002f2d0 r6:0000001b r5:0002f2d0 r4:c7bc4000
[] (arch_ptrace+0x0/0x49c) from [] (sys_ptrace+0x10c/0x160)
r6:0000001b r5:00000000 r4:c786a640
[] (sys_ptrace+0x0/0x160) from [] (ret_fast_syscall+0x0/0x28
)
r9:c7bc8000 r8:c00760a4 r7:0000001a r6:00000000 r5:0002458c
r4:0000001b
Code: e3c2203f e5923004 e2833001 e5823004 (eef84a10)
---[ end trace 6097dd136c9a3fcd ]---
note: gdbserver[532] exited with preempt_count 2
BUG: scheduling while atomic: gdbserver/532/0x40000002
Modules linked in:
Backtrace:
[] (dump_backtrace+0x0/0x114) from [] (dump_stack+0x18/0x1c)
r7:c7bc8000 r6:c7bcbd10 r5:c7954960 r4:00000000
[] (dump_stack+0x0/0x1c) from [] (__schedule_bug+0x54/0x60)
[] (__schedule_bug+0x0/0x60) from [] (schedule+0x7c/0x360)
r5:c7954960 r4:c7bc8000
[] (schedule+0x0/0x360) from [] (__cond_resched+0x28/0x38)
[] (__cond_resched+0x0/0x38) from [] (_cond_resched+0x34/0x4
4)
r5:00012000 r4:c05e7dc0
[] (_cond_resched+0x0/0x44) from [] (unmap_vmas+0x5b8/0x66c)
[] (unmap_vmas+0x0/0x66c) from [] (exit_mmap+0xc4/0x1f8)
[] (exit_mmap+0x0/0x1f8) from [] (mmput+0x40/0x118)
r7:c7b9b1b4 r6:c7b9b180 r5:00000000 r4:c7b9b180
[] (mmput+0x0/0x118) from [] (exit_mm+0x150/0x15c)
r5:c7954960 r4:c7bc8000
[] (exit_mm+0x0/0x15c) from [] (do_exit+0x1a0/0x6b4)
r7:c008257c r6:c7954960 r5:00000001 r4:0000000b
[] (do_exit+0x0/0x6b4) from [] (die+0x298/0x2cc)
[] (die+0x0/0x2cc) from [] (baddataabort+0x0/0x58)
[] (arm_notify_die+0x0/0x5c) from [] (do_undefinstr+0x160/0x
174)
[] (do_undefinstr+0x0/0x174) from [] (__und_svc+0x44/0x60)
Exception stack(0xc7bc9eb0 to 0xc7bc9ef8)
9ea0: c7bc4000 0000001a c7bc8000 00000002
9ec0: c7bc4000 0002f2d0 0000001b 0002f2d0 00000000 c7bc8000 00000001 c7bc9f14
9ee0: c7bc9f18 c7bc9ef8 c00776b8 c0082578 80000013 ffffffff
r7:00000001 r6:c7bc8050 r5:c7bc9ee4 r4:00000003
Backtrace aborted due to bad frame pointer
BUG: scheduling while atomic: gdbserver/532/0x40000002
Modules linked in:
Backtrace:
[] (dump_backtrace+0x0/0x114) from [] (dump_stack+0x18/0x1c)
r7:c7bc8000 r6:00000000 r5:c7954960 r4:00000000
[] (dump_stack+0x0/0x1c) from [] (__schedule_bug+0x54/0x60)
[] (__schedule_bug+0x0/0x60) from [] (schedule+0x7c/0x360)
r5:c7954960 r4:c7bc8000
[] (schedule+0x0/0x360) from [] (__cond_resched+0x28/0x38)
[] (__cond_resched+0x0/0x38) from [] (_cond_resched+0x34/0x4
4)
r5:00000007 r4:c79fca80
[] (_cond_resched+0x0/0x44) from [] (put_files_struct+0x8c/0
xdc)
[] (put_files_struct+0x0/0xdc) from [] (exit_files+0x5c/0x60
)
r9:00000008 r8:00000000 r7:c008257c r6:c7954960 r5:00000001
r4:c79fca80
[] (exit_files+0x0/0x60) from [] (do_exit+0x1b0/0x6b4)
r5:00000001 r4:0000000b
[] (do_exit+0x0/0x6b4) from [] (die+0x298/0x2cc)
[] (die+0x0/0x2cc) from [] (baddataabort+0x0/0x58)
[] (arm_notify_die+0x0/0x5c) from [] (do_undefinstr+0x160/0x
174)
[] (do_undefinstr+0x0/0x174) from [] (__und_svc+0x44/0x60)
Exception stack(0xc7bc9eb0 to 0xc7bc9ef8)
9ea0: c7bc4000 0000001a c7bc8000 00000002
9ec0: c7bc4000 0002f2d0 0000001b 0002f2d0 00000000 c7bc8000 00000001 c7bc9f14
9ee0: c7bc9f18 c7bc9ef8 c00776b8 c0082578 80000013 ffffffff
r7:00000001 r6:c7bc8050 r5:c7bc9ee4 r4:00000003
Backtrace aborted due to bad frame pointer
Segmentation fault
# HELLO
在虚拟机上写了一个helloworld程序, 用它的交叉编译器编译, 可以在目标板运行,
把它的gdbserver和 helloworld拷贝到目标板
看资料都是先在目标板上运行gdbserver, 然后在虚拟机上运行gdb进行调试
于是在开发板上我敲
gdbserver "PC的IP":1234 HELLOWORLD
此时报很多错, 最后helloworld居然还执行了起来, 按我的理解, 这里只是服务器, 运行应该在pC上才是啊
附:出错信息
Process /root/a.out created; pid = 535
Internal error: Oops - undefined instruction: 0 [#2] PREEMPT
last sysfs file: /sys/devices/virtual/vc/vcsa6/dev
Modules linked in:
CPU: 0 Tainted: G D (2.6.33-rc4 #13)
PC is at vfp_sync_state+0x24/0x88
LR is at arch_ptrace+0x3c0/0x49c
pc : [] lr : [] psr: 80000013
sp : c7bc9ef8 ip : c7bc9f18 fp : c7bc9f14
r10: 00000001 r9 : c7bc8000 r8 : 00000000
r7 : 0002f2d0 r6 : 0000001b r5 : 0002f2d0 r4 : c7bc4000
r3 : 00000002 r2 : c7bc8000 r1 : 0000001a r0 : c7bc4000
Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 0005317f Table: c7b38000 DAC: 00000015
Process gdbserver (pid: 532, stack limit = 0xc7bc8270)
Stack: (0xc7bc9ef8 to 0xc7bca000)
9ee0: c7bc4000 0002f2d0
9f00: 0000001b 0002f2d0 c7bc9f7c c7bc9f18 c00776b8 c0082564 c7bc9f54 c7bc9f28
9f20: c00f37d4 c010b510 00000000 00000000 c7bc7680 00000000 c79fca80 c7bc7680
9f40: c00760a4 00000008 c7bc9f64 00000217 c7bc9f6c c7bc9f60 c00a289c c00a2850
9f60: c7bc9f7c c786a640 00000000 0000001b c7bc9fa4 c7bc9f80 c0098b90 c0077308
9f80: 0000001b 0002458c 00000000 0000001a c00760a4 c7bc8000 00000000 c7bc9fa8
9fa0: c0075f20 c0098a94 0000001b 0002458c 0000001b 00000217 00000000 0002f2d0
9fc0: 0000001b 0002458c 00000000 0000001a 0002f2d0 0002455c 00000001 00026664
9fe0: 0000001b bec2da00 00014aac 40107c74 20000010 0000001b 00000000 00000000
Backtrace:
[] (vfp_sync_state+0x0/0x88) from [] (arch_ptrace+0x3c0/0x49
c)
r7:0002f2d0 r6:0000001b r5:0002f2d0 r4:c7bc4000
[] (arch_ptrace+0x0/0x49c) from [] (sys_ptrace+0x10c/0x160)
r6:0000001b r5:00000000 r4:c786a640
[] (sys_ptrace+0x0/0x160) from [] (ret_fast_syscall+0x0/0x28
)
r9:c7bc8000 r8:c00760a4 r7:0000001a r6:00000000 r5:0002458c
r4:0000001b
Code: e3c2203f e5923004 e2833001 e5823004 (eef84a10)
---[ end trace 6097dd136c9a3fcd ]---
note: gdbserver[532] exited with preempt_count 2
BUG: scheduling while atomic: gdbserver/532/0x40000002
Modules linked in:
Backtrace:
[] (dump_backtrace+0x0/0x114) from [] (dump_stack+0x18/0x1c)
r7:c7bc8000 r6:c7bcbd10 r5:c7954960 r4:00000000
[] (dump_stack+0x0/0x1c) from [] (__schedule_bug+0x54/0x60)
[] (__schedule_bug+0x0/0x60) from [] (schedule+0x7c/0x360)
r5:c7954960 r4:c7bc8000
[] (schedule+0x0/0x360) from [] (__cond_resched+0x28/0x38)
[] (__cond_resched+0x0/0x38) from [] (_cond_resched+0x34/0x4
4)
r5:00012000 r4:c05e7dc0
[] (_cond_resched+0x0/0x44) from [] (unmap_vmas+0x5b8/0x66c)
[] (unmap_vmas+0x0/0x66c) from [] (exit_mmap+0xc4/0x1f8)
[] (exit_mmap+0x0/0x1f8) from [] (mmput+0x40/0x118)
r7:c7b9b1b4 r6:c7b9b180 r5:00000000 r4:c7b9b180
[] (mmput+0x0/0x118) from [] (exit_mm+0x150/0x15c)
r5:c7954960 r4:c7bc8000
[] (exit_mm+0x0/0x15c) from [] (do_exit+0x1a0/0x6b4)
r7:c008257c r6:c7954960 r5:00000001 r4:0000000b
[] (do_exit+0x0/0x6b4) from [] (die+0x298/0x2cc)
[] (die+0x0/0x2cc) from [] (baddataabort+0x0/0x58)
[] (arm_notify_die+0x0/0x5c) from [] (do_undefinstr+0x160/0x
174)
[] (do_undefinstr+0x0/0x174) from [] (__und_svc+0x44/0x60)
Exception stack(0xc7bc9eb0 to 0xc7bc9ef8)
9ea0: c7bc4000 0000001a c7bc8000 00000002
9ec0: c7bc4000 0002f2d0 0000001b 0002f2d0 00000000 c7bc8000 00000001 c7bc9f14
9ee0: c7bc9f18 c7bc9ef8 c00776b8 c0082578 80000013 ffffffff
r7:00000001 r6:c7bc8050 r5:c7bc9ee4 r4:00000003
Backtrace aborted due to bad frame pointer
BUG: scheduling while atomic: gdbserver/532/0x40000002
Modules linked in:
Backtrace:
[] (dump_backtrace+0x0/0x114) from [] (dump_stack+0x18/0x1c)
r7:c7bc8000 r6:00000000 r5:c7954960 r4:00000000
[] (dump_stack+0x0/0x1c) from [] (__schedule_bug+0x54/0x60)
[] (__schedule_bug+0x0/0x60) from [] (schedule+0x7c/0x360)
r5:c7954960 r4:c7bc8000
[] (schedule+0x0/0x360) from [] (__cond_resched+0x28/0x38)
[] (__cond_resched+0x0/0x38) from [] (_cond_resched+0x34/0x4
4)
r5:00000007 r4:c79fca80
[] (_cond_resched+0x0/0x44) from [] (put_files_struct+0x8c/0
xdc)
[] (put_files_struct+0x0/0xdc) from [] (exit_files+0x5c/0x60
)
r9:00000008 r8:00000000 r7:c008257c r6:c7954960 r5:00000001
r4:c79fca80
[] (exit_files+0x0/0x60) from [] (do_exit+0x1b0/0x6b4)
r5:00000001 r4:0000000b
[] (do_exit+0x0/0x6b4) from [] (die+0x298/0x2cc)
[] (die+0x0/0x2cc) from [] (baddataabort+0x0/0x58)
[] (arm_notify_die+0x0/0x5c) from [] (do_undefinstr+0x160/0x
174)
[] (do_undefinstr+0x0/0x174) from [] (__und_svc+0x44/0x60)
Exception stack(0xc7bc9eb0 to 0xc7bc9ef8)
9ea0: c7bc4000 0000001a c7bc8000 00000002
9ec0: c7bc4000 0002f2d0 0000001b 0002f2d0 00000000 c7bc8000 00000001 c7bc9f14
9ee0: c7bc9f18 c7bc9ef8 c00776b8 c0082578 80000013 ffffffff
r7:00000001 r6:c7bc8050 r5:c7bc9ee4 r4:00000003
Backtrace aborted due to bad frame pointer
Segmentation fault
# HELLO
|
开发板上跑gdbserver, 开发机的linux上跑和gdbserver版本一致的gdb.
|
gdbserver环境配置好没有?