Skip to content

Commit 5f3d7b8

Browse files
committed
Enable GDB TUI support via PDCurses
This introduces yet another dependency, but it's a substantial gain for a small cost. GDB lacks "--with-libcurses-prefix" so I had to manually list the path in LDFLAGS. Otherwise the GDB configure script fails to find waddstr and gives up even though actually linking gdb.exe works fine without it. The capitalized file name for PDCurses introduces a small sorting issue in SHA256SUMS. Lexicographic collation with PDCurses at the top? A more natural collation with PDCurses in the middle? I generate the listing via "sha256sum *" in Bash, and in my locale Bash uses the latter, so that's what I'll use.
1 parent 34945ff commit 5f3d7b8

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Dockerfile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ ARG MINGW_VERSION=10.0.0
1414
ARG MPC_VERSION=1.2.1
1515
ARG MPFR_VERSION=4.1.0
1616
ARG NASM_VERSION=2.15.05
17+
ARG PDCURSES_VERSION=3.9
1718
ARG CPPCHECK_VERSION=2.8
1819
ARG VIM_VERSION=9.0
1920

@@ -36,6 +37,7 @@ RUN curl --insecure --location --remote-name-all --remote-header-name \
3637
https://www.nasm.us/pub/nasm/releasebuilds/$NASM_VERSION/nasm-$NASM_VERSION.tar.xz \
3738
http://deb.debian.org/debian/pool/main/u/universal-ctags/universal-ctags_0+git$CTAGS_VERSION.orig.tar.gz \
3839
https://downloads.sourceforge.net/project/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v$MINGW_VERSION.tar.bz2 \
40+
https://downloads.sourceforge.net/project/pdcurses/pdcurses/$PDCURSES_VERSION/PDCurses-$PDCURSES_VERSION.tar.gz \
3941
https://github.com/danmar/cppcheck/archive/$CPPCHECK_VERSION.tar.gz
4042
COPY src/SHA256SUMS $PREFIX/src/
4143
RUN sha256sum -c $PREFIX/src/SHA256SUMS \
@@ -50,6 +52,7 @@ RUN sha256sum -c $PREFIX/src/SHA256SUMS \
5052
&& tar xJf mpfr-$MPFR_VERSION.tar.xz \
5153
&& tar xzf make-$MAKE_VERSION.tar.gz \
5254
&& tar xjf mingw-w64-v$MINGW_VERSION.tar.bz2 \
55+
&& tar xzf PDCurses-$PDCURSES_VERSION.tar.gz \
5356
&& tar xJf nasm-$NASM_VERSION.tar.xz \
5457
&& tar xjf vim-$VIM_VERSION.tar.bz2 \
5558
&& tar xzf cppcheck-$CPPCHECK_VERSION.tar.gz
@@ -315,15 +318,22 @@ RUN /expat-$EXPAT_VERSION/configure \
315318
&& make -j$(nproc) \
316319
&& make install
317320

321+
WORKDIR /PDCurses-$PDCURSES_VERSION
322+
RUN make -j$(nproc) -C wincon \
323+
CFLAGS="-I.. -Os -DPDC_WIDE" CC=$ARCH-gcc pdcurses.a \
324+
&& cp wincon/pdcurses.a /deps/lib/libcurses.a \
325+
&& cp curses.h /deps/include
326+
318327
WORKDIR /gdb
319328
RUN sed -i 's/quiet = 0/quiet = 1/' /gdb-$GDB_VERSION/gdb/main.c \
320329
&& /gdb-$GDB_VERSION/configure \
321330
--host=$ARCH \
322331
--with-libexpat-prefix=/deps \
323332
--with-libgmp-prefix=/deps \
324-
CFLAGS="-Os -D_WIN32_WINNT=0x502" \
325-
CXXFLAGS="-Os" \
326-
LDFLAGS="-s" \
333+
--enable-tui \
334+
CFLAGS="-Os -D_WIN32_WINNT=0x502 -DPDC_WIDE" \
335+
CXXFLAGS="-Os -DPDC_WIDE" \
336+
LDFLAGS="-s -L/deps/lib" \
327337
&& make MAKEINFO=true -j$(nproc) \
328338
&& cp gdb/gdb.exe $PREFIX/bin/
329339

src/SHA256SUMS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ ba6b430aed72c63a3768531f6a3ffc2b0fde2c57a3b251450dcf489a894f0894 mingw-w64-v10.
1010
17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459 mpc-1.2.1.tar.gz
1111
0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f mpfr-4.1.0.tar.xz
1212
3caf6729c1073bf96629b57cee31eeb54f4f8129b01902c73428836550b30a3f nasm-2.15.05.tar.xz
13+
590dbe0f5835f66992df096d3602d0271103f90cf8557a5d124f693c2b40d7ec PDCurses-3.9.tar.gz
1314
d2e851f5c51744c4e175200bc1ac7a2e9cab18aa6b9f8aabdffeacdf8324b94d universal-ctags_0+git20200824.orig.tar.gz
1415
a6456bc154999d83d0c20d968ac7ba6e7df0d02f3cb6427fb248660bacfb336e vim-9.0.tar.bz2

0 commit comments

Comments
 (0)