-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package request: gdb-python #993
Comments
I was able to build gdb with python support by first building python2, then replacing TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gdb/
TERMUX_PKG_DESCRIPTION="The standard GNU Debugger that runs on many Unix-like systems and works for many programming languages"
TERMUX_PKG_DEPENDS="liblzma, libexpat, readline, ncurses, libmpfr, python2"
TERMUX_PKG_VERSION=8.2
TERMUX_PKG_SHA256=c3a441a29c7c89720b734e5a9c6289c0a06be7e0c76ef538f7bbcef389347c39
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gdb/gdb-${TERMUX_PKG_VERSION}.tar.xz
# gdb can not build with our normal --disable-static: https://sourceware.org/bugzilla/show_bug.cgi?id=15916
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--with-system-readline
--with-curses
--with-python
--enable-static
ac_cv_func_getpwent=no
ac_cv_func_getpwnam=no
"
TERMUX_PKG_MAKE_INSTALL_TARGET="-C gdb install"
TERMUX_PKG_BUILD_IN_SRC="yes"
termux_step_pre_configure() {
# Fix "undefined reference to 'rpl_gettimeofday'" when building:
export gl_cv_func_gettimeofday_clobber=no
export gl_cv_func_gettimeofday_posix_signature=yes
export gl_cv_func_realpath_works=yes
export gl_cv_func_lstat_dereferences_slashed_symlink=yes
export gl_cv_func_memchr_works=yes
export gl_cv_func_stat_file_slash=yes
export gl_cv_func_frexp_no_libm=no
export gl_cv_func_strerror_0_works=yes
export gl_cv_func_working_strerror=yes
export gl_cv_func_getcwd_path_max=yes
export CFLAGS="$CFLAGS -I/home/builder/.termux-build/python2/src/Include -I/home/builder/.termux-build/python2/build"
export CXXFLAGS="$CXXFLAGS -I/home/builder/.termux-build/python2/src/Include -I/home/builder/.termux-build/python2/build"
} Here's a built package instead if you don't want to build it yourself (note that it doesn't seem to have curses for tui, but if you care about that then just install cgdb, it's better anyway) |
I also added this patch to get the warning about unusable hardware breakpoints to go away as it was interfering with my work diff -u -r ../gdb-8.1/gdb/nat/aarch64-linux-hw-point.c ./gdb/nat/aarch64-linux-hw-point.c
--- ../gdb-8.1/gdb/nat/aarch64-linux-hw-point.c 2018-09-05 07:27:13.000000000 +0000
+++ ./gdb/nat/aarch64-linux-hw-point.c 2018-12-14 04:23:56.153249285 +0000
@@ -780,8 +780,8 @@
}
else
{
- warning (_("Unable to determine the number of hardware watchpoints"
- " available."));
+ //warning (_("Unable to determine the number of hardware watchpoints"
+ // " available."));
aarch64_num_wp_regs = 0;
}
@@ -802,8 +802,8 @@
}
else
{
- warning (_("Unable to determine the number of hardware breakpoints"
- " available."));
+ //warning (_("Unable to determine the number of hardware breakpoints"
+ // " available."));
aarch64_num_bp_regs = 0;
}
} If you really want/need hardware breakpoint or watchpoint support, you will need to recompile your kernel. Modify this setting in the default arch Kconfig (not the one for your board): diff --git a/arch/Kconfig b/arch/Kconfig
index 240bda0276b..8093bdaa8af 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -239,7 +239,7 @@ config HAVE_DMA_API_DEBUG
bool
config HAVE_HW_BREAKPOINT
- bool
+ def_bool y
depends on PERF_EVENTS
config HAVE_MIXED_BREAKPOINTS_REGS Then clean, build it, flash the resulting boot image and you should be set. |
@liamwhite Can you build the package for arm i tried to compile it on my device but all i get was error. How can i compile it if i have already installed gdb with no python-support? I want to use gef to practice binary exploitation Sent from my Galaxy J1(2016) using FastHub |
I notice that gdb installed doesn't support python scripting when I execute
gdb -batch -q --nx -ex 'pi import platform; print(".".join(platform.python_version_tuple()[:2]))'
it says
Python scripting is not supported in this copy of GDB.
The text was updated successfully, but these errors were encountered: