本帖最后由 ifosn 于 2010-05-06 13:05 编辑 我有三个文件:Makefile如下 A: A.c A.h B.o C.o gcc -lm -ggdb -o A A.c B.o C.o B: B.c B.h gcc -ggdb -o B.o B.c C: C.c C.h gcc -ggdb -o C.o C.h 我希望调B中的一个函数,先b function_name,然后运行到该断点,再step,想进入函数,但是提示: Single stepping until exit from function XXX, which has no line number information. 没有行信息,但是我编译和链接是都加...
by ifosn - C/C++ - 2010-05-06 19:47:56 阅读(2613) 回复(4)
比如说我在main.c里调用sayhello.c里实现的函数say_hello(),应该怎么跟踪呢? 列出文件main.c内容 查看say_helo的行数 list main.c:line_number 在文件main.c的第line_number行设置断点 break main.c:line_number 走到say_hello的时候,用s进入say_hello 然后用next单步跟踪 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/11702/showart_302270.html
一个程序Makefile如下: # # makefile for layer3 # OBJS = layer3.o common.o decode.o huffman.o play: $(OBJS) gcc -g -o play $(OBJS) -lm layer3.o: common.h decode.h common.o: common.h decode.o: decode.h common.h huffman.h huffman.o: huffman.h common.h .PHONY: clean clean: rm paly $(OBJS) ================================= gdb file play l l ../sysdeps/i386/elf/start.S: No such file or d...
用gdb调试QEMU的源码,出现段错误. 想在某个文件处设置断点,在网上查可以用 break file_name:line_num 我用break disas.c:225 但显示的是 No symbol table is loaded. Use the "file" command. 用file disas.c 显示 /root/qemu-0.9.1/disas.c: not in executable format: File format not recognized 直接运行编译后的qemu,提示段错误 用bt查看 只能看到 #0 0xb7da5689 in vfprintf() from /lib/i686/cmov/libc.so.6 #1 0xb7d...
gdb是Linux中强大的程序调试工具,熟练掌握该软件的使用对软件开发有很大的帮助,gdb的使用很简单,但想要使用gdb调试的程序必需在编 译的时候加了调试选项(-g),这样一来要对程序进行调试就要对gcc编译选项中加上这一参数,如果直接在终端中用命令编译(不写makefile),那 么语法很简单,如下: 单文件(如main.c):gcc -g main.c -o main或gcc -o main main.c -g 多文件(如main.c func.c func.h):gcc -g func.c main.c -o m...
我的emacs 是 GNU Emacs 22.2.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars) .emacs中的配置 ;; gdb (setq toolbar-mode t) ;display the gdb toolbar (setq gdb-many-windows t) ;gdb many windows mode (load-library "multi-gud.el") (load-library "multi-gdb-ui.el") 调试单个文件的时候是没问题的,但是调试多个文件的时候就报错,不知道怎么回事? 单文件 Makefile sample sample.c sample.o semantic.cache 编...
比如源文件有: file1.c file2.c main.c(包含file1.c file2.c ) 如果想在在file1.c中设置一个断点,如何做呢? 小弟只会设置一个文件中的断点,今天突然碰到这个问题,所以问问。 请大家多指点! 谢谢
请教: 需调试的程序是多个源文件编译的,info sources能看到一大堆,调试的时候缺省是在main()所在的文件,如何切换至其他源文件?