core dump进行gdb调试的时候提示no debugging symbols found

news/2024/10/18 12:24:25/

 gdb调试的时候提示如下:no debugging symbols found,这说明可执行文件编译时没有包含了调试符号,所以需要修改makefile,编译时要-g

zbb@ihp:~/core_dump$ mips-linux-gnu-gdb video_test core-video_test-11-0-0-426-7836
GNU gdb (Ingenic Ingenic r3.3.0-gcc540 Smaller Size 2023.05-22) 7.10.50.20150827-cvs
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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=i686-pc-linux-gnu --target=mips-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from video_test...(no debugging symbols found)...done.
[New LWP 426]warning: Could not load shared library symbols for 8 libraries, e.g. /lib/libpthread.so.0.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `./video_test'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x004008a8 in _ftext ()
(gdb)
(gdb)
(gdb)
(gdb)
(gdb)
(gdb)
(gdb) bt
#0  0x004008a8 in _ftext ()
(gdb)
#0  0x004008a8 in _ftext ()
(gdb)
#0  0x004008a8 in _ftext ()
(gdb)
#0  0x004008a8 in _ftext ()
(gdb) list
No symbol table is loaded.  Use the "file" command.
(gdb) q

修改makefile如下

#CFLAGS = $(INCLUDES) -O2 -Wall -march=mips32r2

CFLAGS = $(INCLUDES) -g -Wall -march=mips32r2(改为这个)

CONFIG_UCLIBC_BUILD=yCROSS_COMPILE ?= mips-linux-gnu-CC = $(CROSS_COMPILE)gcc
CPLUSPLUS = $(CROSS_COMPILE)g++
LD = $(CROSS_COMPILE)ld
AR = $(CROSS_COMPILE)ar cr
STRIP = $(CROSS_COMPILE)strip#CFLAGS = $(INCLUDES) -O2 -Wall -march=mips32r2
CFLAGS = $(INCLUDES) -g -Wall -march=mips32r2
ifeq ($(CONFIG_UCLIBC_BUILD), y)
CFLAGS += -muclibc
LDFLAG += -muclibc
endififeq ($(CONFIG_UCLIBC_BUILD), y)
SDK_LIB_DIR = ./lib
else
SDK_LIB_DIR = ../../lib/glibc
endifSDK_INC_DIR = ./INCLUDES = -I$(SDK_INC_DIR)LIBS = $(SDK_LIB_DIR)/libimp.a $(SDK_LIB_DIR)/libalog.a $(SDK_LIB_DIR)/libmove_inf.a\$(SDK_LIB_DIR)/libsysutils.a $(SDK_LIB_DIR)/libjzdl.a $(SDK_LIB_DIR)/libpersonDet_inf.a $(SDK_LIB_DIR)/libmxu_contrib.a\$(SDK_LIB_DIR)/libmxu_core.a $(SDK_LIB_DIR)/libmxu_imgproc.a $(SDK_LIB_DIR)/libmxu_merge.a $(SDK_LIB_DIR)/libmxu_objdetect.a \$(SDK_LIB_DIR)/libmxu_video.aLDFLAG += -Wl,-gc-sectionsSAMPLES = video_test \all: 	$(SAMPLES)video_test: main.o $(SDK_LIB_DIR)/libdsp.a $(SDK_LIB_DIR)/libimp.a $(SDK_LIB_DIR)/libalog.a $(SDK_LIB_DIR)/libmove_inf.a\$(SDK_LIB_DIR)/libsysutils.a $(SDK_LIB_DIR)/libjzdl.a $(SDK_LIB_DIR)/libpersonDet_inf.a $(SDK_LIB_DIR)/libmxu_contrib.a\$(SDK_LIB_DIR)/libmxu_core.a $(SDK_LIB_DIR)/libmxu_imgproc.a $(SDK_LIB_DIR)/libmxu_merge.a $(SDK_LIB_DIR)/libmxu_objdetect.a \$(SDK_LIB_DIR)/libmxu_video.a  $(CPLUSPLUS) $(LDFLAG) -o $@ $^ $(LIBS) -lpthread -lm -lrt -ldl%.o:%.c sample-common.h$(CPLUSPLUS) -c $(CFLAGS) $< -o $@clean:rm -f *.o *~distclean: cleanrm -f $(SAMPLES)

修改后调试成功如下
 

zbb@ihp:~/core_dump$ mips-linux-gnu-gdb video_test core-video_test-11-0-0-224-455
GNU gdb (Ingenic Ingenic r3.3.0-gcc540 Smaller Size 2023.05-22) 7.10.50.20150827-cvs
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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=i686-pc-linux-gnu --target=mips-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from video_test...done.
[New LWP 224]warning: Could not load shared library symbols for 8 libraries, e.g. /lib/libpthread.so.0.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `./video_test'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x004008a8 in main () at main.c:9
9               int i = *ptr;
(gdb)
(gdb)
(gdb)
(gdb) bt
#0  0x004008a8 in main () at main.c:9
(gdb)
#0  0x004008a8 in main () at main.c:9
(gdb)
#0  0x004008a8 in main () at main.c:9
(gdb)
#0  0x004008a8 in main () at main.c:9
(gdb)
#0  0x004008a8 in main () at main.c:9
(gdb)
#0  0x004008a8 in main () at main.c:9
(gdb) list
4
5        * Copyright (C) 2017 Ingenic Semiconductor Co.,Ltd
6        *
7        */
8
9       #include <unistd.h>
10      #include <sys/ioctl.h>
11      #include <sys/prctl.h>
12      #include <string.h>
13      #include <stdio.h>
(gdb)
Line number 14 out of range; main.c has 13 lines.
(gdb)
Line number 14 out of range; main.c has 13 lines.
(gdb)
Line number 14 out of range; main.c has 13 lines.
(gdb)
Line number 14 out of range; main.c has 13 lines.
(gdb)
Line number 14 out of range; main.c has 13 lines.
(gdb)


http://www.ppmy.cn/news/1432246.html

相关文章

SpringSecurity 第三篇(常用处理器,权限校验,跨域问题)

SpringSecurity 权限校验自定义权限校验方法 CSRF登陆成功处理器登出成功处理器注销成功处理器 权限校验 hasAuthority&#xff1a;方法只能够传入一个参数 hasAnyAuthority&#xff1a;方法可以传入多个权限&#xff0c;只有用户有其中任意一个权限都可以进行访问 hasRole&am…

vue2通过$refs调用子组件方法

问题描述 提示&#xff1a;这里简述项目相关背景&#xff1a; 父组件更新筛选项时&#xff0c;需要重置子组件相关参数。使用$refs时使用this.$refs[productCostTableRef].resetFn(resName) 的写法&#xff0c;发生以下报错&#xff1a; 但是该方法在调用elementui 组件时不会…

解决配置Tomcat时,找不到war和war exploded问题

解决配置Tomcat时&#xff0c;找不到war和war exploded问题 文章目录 解决配置Tomcat时&#xff0c;找不到war和war exploded问题前言一、解决方法&#xff1a;1. war exploded2. war 总结 前言 提示&#xff1a;以下是本篇文章正文内容&#xff1a; 一、解决方法&#xff1a;…

python合并不同文件夹相同文件名的文件

要求&#xff1a; 合并来自不同文件夹下相同csv文件&#xff0c;如&#xff1a; 三个文件夹均含有1.csv&#xff0c;2.csv&#xff0c;3.csv等等文件&#xff0c;现在对文件进行合并。思路&#xff1a;先创建一个文件名list&#xff0c;然后遍历。 python代码&#xff1a; da…

深入剖析Tomcat(三) 实现一个简易连接器

Tomcat中的servlet容器叫做Catalina&#xff0c;Catalina有两个主要模块&#xff1a;连接器与容器。在本章&#xff0c;将会建立一个连接器来增强第二章中应用程序的功能&#xff0c;用一种更好的方式来创建request与response对象。 截止文章编写日期&#xff0c;servlet规范已…

海康智能相机FTP本地存图流程

背景&#xff1a;近期一个新项目需要使用到智能相机&#xff0c;借助智能相机算法直接输出检测结果并将相机图像进行本地化保存和展示。由于申购目标智能相机未到&#xff0c;暂时使用测试智能相机。 目标智能相机型号&#xff1a;海康智能相机MV-SC3050XC 当前测试相机型号…

Spark面试整理-如何配置和管理Spark集群的资源,包括内存、CPU和存储

配置和管理Apache Spark集群的资源是确保高效运行Spark应用的关键步骤。合理的资源配置可以提高性能,避免资源浪费,并确保任务顺利执行。以下是配置和管理Spark集群资源(包括内存、CPU和存储)的一些指导原则: 内存管理 Executor内存设置:通过spark.executor.memory配置每…

加密、解密、签名、验签、数字证书、CA浅析

一、加密和解密 加密和解密应用的很广&#xff0c;主要作用就是防止数据或者明文被泄露。 加解密算法主要有两大类&#xff0c;对称加密和非对称加密。对称加密就是加密和解密的密钥都是一个&#xff0c;典型的有AES算法。非对称加密就是有公钥和私钥&#xff0c;公钥可以发布…