gdb hello-world如下:
- flushthink@gentoo64 ~/work/libevent-2.0.21-stable/sample $ gdb hello-world
- GNU gdb (Gentoo 7.5.1 p2) 7.5.1
- Copyright (C) 2012 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 \"x86_64-pc-linux-gnu\".
- For bug reporting instructions, please see:
- <
- \"/home/flushthink/work/libevent-2.0.21-stable/sample/hello-world\": not in executable format: File format not recognized
- (gdb)
- flushthink@gentoo64 ~/work/libevent-2.0.21-stable/sample $ file hello-world
- hello-world: POSIX shell script, ASCII text executable
- flushthink@gentoo64 ~/work/libevent-2.0.21-stable/sample $ vim hello-world
- #! /bin/sh
- # hello-world - temporary wrapper script for .libs/hello-world
- # Generated by libtool (GNU libtool) 2.4.2
- #
- # The hello-world program cannot be directly executed until all the libtool
- # libraries that it depends on are installed.
- #
- # This wrapper script should never be moved out of the build directory.
- # If it is, it will not operate correctly.
- # Sed substitution that helps us do robust quoting. It backslashifies
- # metacharacters that are still active within double-quoted strings.
-no-install Link an executable output-file that can't be installed and therefore doesn't need a wrapper script on systems that allow hardcoding of library paths. Useful if the program is only used in the build tree, e.g., for testing or generating other files.
得出了结论(可以./configure --help查看):
./configure --disable-libevent-install && make
这样就可以直接调试了。