出手无招

出手无招

0个粉丝

12

问答

0

专栏

0

资料

出手无招  发布于  2020-03-12 17:06:08
采纳率 0%
12个问答
3147

gcc常用命令

   
本帖最后由 anwafs 于 2020-3-12 17:14 编辑

1 设置core路径
echo "/home/core/core-%e-%p-%t" > /proc/sys/kernel/core_pattern\n

2 启动gdb,根据不同的编译器:
arm-hisiv500-linux-uclibcgnueabi-gdb

3 设置动态库路径
set sysroot /share/10047/lib/arm-hisiv500
set solib-search-path /share/10047/lib/arm-hisiv500

4 装载dora
file dora

5 运行core 文件
core-file ./core-dora-xxxx

6 bt
7 info thread
8 thread xxx


6、 objdum和addr2line
arm-hisiv500-linux-uclibcgnueabi-objdump -D xx.a > /home/XX

arm-hisiv500-linux-uclibcgnueabi-addr2line -e xx 0xddd


7、输入f 1,进入函数
输入p 变量名,打印变量

arm-himix200-linux-gdb
GNU gdb (GNU_GDB-2018.08) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
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=i586-suse-linux --target=arm-linux-gnueabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) set solib-search-path /share/10047/cv500_so/
(gdb) set sysroot /share/10047/cv500_so/
(gdb) file ../test/dora
Reading symbols from ../test/dora...done.
(gdb) core-file core-dora-297-1547654174
[New LWP 297]
[New LWP 305]
[New LWP 301]
[New LWP 350]
[New LWP 445]
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `/home/test/dora AEWB DSP EX2 TVOUT PIC BF PIC'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0xb6dc7708 in do_futex_wait.constprop () from /share/10047/cv500_so/libpthread.so.0
[Current thread is 1 (LWP 297)]
(gdb) info thread
  Id   Target Id         Frame
  80   LWP 445           0xb6dc7704 in do_futex_wait.constprop () from /share/10047/cv500_so/libpthread.so.0
  79   LWP 444           0xb6dc7704 in do_futex_wait.constprop () from /share/10047/cv500_so/libpthread.so.0
  78   LWP 443           0xb6dc7704 in do_futex_wait.constprop () from /share/10047/cv500_so/libpthread.so.0
  77   LWP 442           0xb6dc7704 in do_futex_wait.constprop () from /share/10047/cv500_so/libpthread.so.0
  76   LWP 441           0xb6dc7704 in do_futex_wait.constprop () from /share/10047/cv500_so/libpthread.so.0
  75   LWP 398           0xb6dc7704 in do_futex_wait.constprop () from /share/10047/cv500_so/libpthread.so.0
  74   LWP 394           0xb48ab0b4 in nanosleep () from /share/10047/cv500_so/libc.so.6
  5    LWP 344           0xb6dc499c in pthread_cond_timedwait@@GLIBC_2.4 () from /share/10047/cv500_so/libpthread.so.0
  4    LWP 350           0xb6dc499c in pthread_cond_timedwait@@GLIBC_2.4 () from /share/10047/cv500_so/libpthread.so.0
  3    LWP 301           0xb48d9fd8 in select () from /share/10047/cv500_so/libc.so.6
  2    LWP 305           0xb6dc85f4 in __lll_lock_wait () from /share/10047/cv500_so/libpthread.so.0
* 1    LWP 297           0xb6dc7708 in do_futex_wait.constprop () from /share/10047/cv500_so/libpthread.so.0
(gdb) thread 71
[Switching to thread 71 (LWP 389)]
#0  0xb6dc85f4 in __lll_lock_wait () from /share/10047/cv500_so/libpthread.so.0
(gdb) bt
(gdb) bt
#0  0xb6dc85f4 in __lll_lock_wait () from /share/10047/cv500_so/libpthread.so.0
#1  0xb6dbfcd0 in pthread_mutex_lock () from /share/10047/cv500_so/libpthread.so.0
#2  0xb6e24ba0 in OSAL_mutexLock () from /share/10047/cv500_so/libosal.so
#3  0x000747cc in IVS_algFaceStop (thiz=)
    at ../src/alg/face/faceRecognize_KS_HI3516CV500/IVS_algFaceRecognizeKSHI3516CV500.c:1004
#4  0x00069a9c in IVS_stop (thiz=) at ../src/service/service_face.c:143
#5  0x000660a8 in IVS_stop (thiz=0x1441ef0) at ../src/service/ivs_videoanalyse.c:481
#6  0x000ee5b4 in CIntelliDeviceInter::stop (this=this@entry=0x14361e4) at Src/IntelliDeviceInter.cpp:150
#7  0x000e8800 in Intelli::CIntelliDevice::stop (this=this@entry=0x14361b8) at Src/IntelliDevice.cpp:568
#8  0x000e9abc in Intelli::CIntelliDevice::onAppEvent (this=this@entry=0x14361b8, code=..., index=index@entry=0,
    action=action@entry=1505580, param=param@entry=0x0, pData=0x9c2e6ce0, pData@entry=0x4) at Src/IntelliDevice.cpp:1162
#9  0x0016f8c8 in mem_function_void_invoker5, std::allocator >, int, IEventManager::Action, Json::Value const*, Json::Value const*>::invoke, std::allocator >, int, IEventManager::Action, Json::Value const*, Json::Value const*>::X*, void (TFunction5, std::allocator >, int, IEventManager::Action, Json::Value const*, Json::Value const*>::X::*)(std::__cxx11::basic_string, std::allocator >, int, IEventManager::Action, Json::Value const*, Json::Value const*)> (
    o=o@entry=0x14361b8, f=NULL, a1=..., a2=a2@entry
#14 0x001a6be4 in CEventManager::notify (this=this@entry=0x1223f08, code=..., index=index@entry=0,
    action=action@entry=IEventManager::appEventPulse, param=param@entry=0x0, data=data@entry=0x9c2e6ce0) at Src/Manager/EventManager.cpp:495
#15 0x001ad9a0 in Control::CUpgrader::notify (this=this@entry=0xb3106df8, hUserinfo=hUserinfo@entry=false) at Src/Upgrade/Upgrader.cpp:1310
#16 0x001ade20 in Control::CUpgrader::recvTimeout (this=0xb3106df8, param=) at Src/Upgrade/Upgrader.cpp:1297
#17 0x003adca4 in TFunction1::operator() (a1=0, this=0x1562540) at ./Include/Basic/FunctionTemplate.h:317
#18 CTimerThread::threadProc (this=0x1562538) at Src/Time/Timer.cpp:246
#19 0x003a8dcc in (anonymous namespace)::InternalThreadBody (pdat=) at Src/Thread/Thread.cpp:86
#20 0xb6dbcfd4 in start_thread () from /share/10047/cv500_so/libpthread.so.0
#21 0xb48e0ee8 in ?? () from /share/10047/cv500_so/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

(gdb) reg
Undefined command: "reg".  Try "help".
(gdb) info reg
r0             0xac4fe960       2890918240
r1             0x997c2ff8       2575052792
r2             0x4a20   18976
r3             0x77128ce6       1997704422
r4             0x1813621a       403923482
r5             0x3a69c613       980010515
r6             0xfa147efb       4195647227
r7             0x16f4944e       385127502
r8             0x39cf7983       969898371
r9             0x9dac77 10333303
r10            0x9dac74 10333300
r11            0x9dc1cd 10338765
r12            0xdb9dd6e9       3684554473
sp             0xa8283c8c       0xa8283c8c
lr             0x7b34fe9c       2067070620
pc             0xb6ad8768       0xb6ad8768
cpsr           0x20070010       537329680

(gdb) x/128x 0xa8283c8c
0xa8283c8c:     0x00008000      0x003c684c      0x997bfa98      0x00068737
0xa8283c9c:     0xac4fb400      0xb5d3b8e8      0x003c54e4      0x011bff80
0xa8283cac:     0x011c004c      0xb5d3b868      0xa8283d28      0x00068737
0xa8283cbc:     0x00164fd8      0x0002d01e      0x0000000a      0x009dc068
0xa8283ccc:     0x00001a36      0x0000056b      0x00000000      0x00000000
0xa8283cdc:     0x000454e9      0x00000000      0x00000000      0xa8283d30
0xa8283cec:     0xb6f51ab4      0x0000000c      0xb6f4ba88      0x00000005
0xa8283cfc:     0x00000000      0x0002d01e      0x0000000a      0x0002d01e
0xa8283d0c:     0x0000000a      0x00000000      0x00008000      0x00000000
0xa8283d1c:     0x00a610c8      0x00c99210      0xb5d3b8e8      0x997bfa98
0xa8283d2c:     0x0001072f      0x0002c52e      0x0000000a      0x0000001d
0xa8283d3c:     0x00000005      0x01000000      0x5cbf7286      0x008b0000
0xa8283d4c:     0x00000000      0x0002c48e      0x0000000a     

(gdb) x/64x 0xa8283c8c   
0xa8283c8c:     0x00008000      0x003c684c      0x997bfa98      0x00068737
0xa8283c9c:     0xac4fb400      0xb5d3b8e8      0x003c54e4      0x011bff80
0xa8283cac:     0x011c004c      0xb5d3b868      0xa8283d28      0x00068737
0xa8283cbc:     0x00164fd8      0x0002d01e      0x0000000a      0x009dc068
0xa8283ccc:     0x00001a36      0x0000056b      0x00000000      0x00000000
0xa8283cdc:     0x000454e9      0x00000000      0x00000000      0xa8283d30
0xa8283cec:     0xb6f51ab4      0x0000000c      0xb6f4ba88      0x00000005
0xa8283cfc:     0x00000000      0x0002d01e      0x0000000a      0x0002d01e
0xa8283d0c:     0x0000000a      0x00000000      0x00008000      0x00000000
0xa8283d1c:     0x00a610c8      0x00c99210      0xb5d3b8e8      0x997bfa98
0xa8283d2c:     0x0001072f      0x0002c52e      0x0000000a      0x0000001d
0xa8283d3c:     0x00000005      0x01000000      0x5cbf7286      0x008b0000
0xa8283d4c:     0x00000000      0x0002c48e      0x0000000a   

[ry10047@localhost ry10047]$ arm-himix200-linux-addr2line -e dora 0x003c684c
/home/10011/app/packCV500/APP_Basic/Src/Memory/PacketManager.cpp:495
[ry10047@localhost ry10047]$ arm-himix200-linux-addr2line -e dora 0x003c684c 0x003c54e4
/home/10011/app/packCV500/APP_Basic/Src/Memory/PacketManager.cpp:495
/home/10011/app/packCV500/APP_Basic/Src/Memory/PacketInternal.h:116
[ry10047@localhost ry10047]$ arm-himix200-linux-addr2line -e dora 0x003c684c 0x003c54e4 0x00164fd8
/home/10011/app/packCV500/APP_Basic/Src/Memory/PacketManager.cpp:495
/home/10011/app/packCV500/APP_Basic/Src/Memory/PacketInternal.h:116
/home/ry10011/pack/packCV500V1-2/APP_Action/Src/Media/DevVideoEnc.cpp:1993
[ry10047@localhost ry10047]$ arm-himix200-linux-addr2line -e dora 0x003c684c 0x003c54e4 0x00164fd8 0x009dc068
/home/10011/app/packCV500/APP_Basic/Src/Memory/PacketManager.cpp:495
/home/10011/app/packCV500/APP_Basic/Src/Memory/PacketInternal.h:116
/home/ry10011/pack/packCV500V1-2/APP_Action/Src/Media/DevVi

info share
显示动态库范围
(gdb) info share
From        To          Syms Read   Shared Object Library
                        No          linux-vdso.so.1
0xb6ee7b30  0xb6f71b78  No          /share/ry10047/core/door_so/libdal.so
0xb6ebfe28  0xb6ec5d6c  No          /share/ry10047/core/door_so/libosal.so
0xb6eaac10  0xb6eab85c  No          /share/ry10047/core/door_so/libpsg.so
0xb6e92e88  0xb6e97690  No          /share/ry10047/core/door_so/libipc.so
0xb6e7e534  0xb6e7f240  No          /share/ry10047/core/door_so/libmsp.so
0xb6e580f0  0xb6e687f8  No          /share/ry10047/core/door_so/libpthread.so.0
0xb6e41994  0xb6e42864  No          /share/ry10047/core/door_so/libdl.so.2
0xb6e2b730  0xb6e2f15c  No          /share/ry10047/core/door_so/librt.so.1
0xb6768250  0xb6b6948c  No          /share/ry10047/core/door_so/libfacesdk_dv300.so
0xb6713300  0xb6732438  No          /share/ry10047/core/door_so/libgomp.so.1
0xb62fec68  0xb6652650  No          /share/ry10047/core/door_so/libQt5Widgets

info locals
(gdb) info locals
vpssChn = 2
cx_ =
w_ = 2395
p = 0x0
s32Ret =
vpssGrp = 0
stChnAttr = {enChnMode = VPSS_CHN_MODE_USER, u32Width = 854, u32Height = 480, enVideoFormat = VIDEO_FORMAT_LINEAR,
  enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420, enDynamicRange = DYNAMIC_RANGE_SDR8, enCompressMode = COMPRESS_MODE_NONE, stFrameRate = {
    s32SrcFrameRate = -1, s32DstFrameRate = -1}, bMirror = HI_FALSE, bFlip = HI_TRUE, u32Depth = 0, stAspectRatio = {
    enMode = ASPECT_RATIO_NONE, u32BgColor = 0, stVideoRect = {s32X = 0, s32Y = 0, u32Width = 0, u32Height = 0}}}
enRotation = ROTATION_270
cy_ =
h_ = 1535

(gdb) info frame
Stack level 0, frame at 0x959d9128:
pc = 0x7f980c in VDS_drvTraceBoxTransform (../src/platdrv/hi3516cv500/src/vds_drvtracebox.c:518); saved pc = 0x7ea7bc
inlined into frame 1
source language c.
Arglist at unknown address.
Locals at unknown address, Previous frame's sp in sp


输入f 1,进入函数
输入p 变量名,打印变量
我来回答
回答0个
时间排序
认可量排序
易百纳技术社区暂无数据
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
+ 添加网盘链接/附件

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

易百纳技术社区