[Bug tui/25597] New: Missing ncurses.h causes miscompilation of python/py-tui.c

joelkevinjones at gmail dot com sourceware-bugzilla@sourceware.org
Mon Feb 24 17:50:00 GMT 2020


https://sourceware.org/bugzilla/show_bug.cgi?id=25597

            Bug ID: 25597
           Summary: Missing ncurses.h causes miscompilation of
                    python/py-tui.c
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tui
          Assignee: unassigned at sourceware dot org
          Reporter: joelkevinjones at gmail dot com
  Target Milestone: ---

Using commit a98c743fdf721a2333220209ca15e147badb55d1 on a system that doesn't
have ncurses installed, the following results:

In file included from ../../binutils-gdb/gdb/python/py-tui.c:24:0:
../../binutils-gdb/gdb/gdb_curses.h:47:21: fatal error: ncurses.h: No such file
or directory
compilation terminated.
Makefile:1600: recipe for target 'python/py-tui.o' failed
make[2]: *** [python/py-tui.o] Error 1

I can fix it by moving the guard for TUI, but I don't think that is the right
fix,as, at least as I read it, gdb_curses.h has the pre-processor macro
HAVE_NCURSES_H defined, which it shouldn't.

$ git diff
diff --git a/gdb/python/py-tui.c b/gdb/python/py-tui.c
index 4cb86ae..ba44ffb 100644
--- a/gdb/python/py-tui.c
+++ b/gdb/python/py-tui.c
@@ -21,9 +21,9 @@
 #include "defs.h"
 #include "arch-utils.h"
 #include "python-internal.h"
+#ifdef TUI
 #include "gdb_curses.h"

-#ifdef TUI

 #include "tui/tui-data.h"
 #include "tui/tui-io.h"

This is on Ubuntu 16.04.4 LTS with the following:
$ uname -a
Linux gbt2s-8 4.13.0-38-generic #43~16.04.1-Ubuntu SMP Wed Mar 14 17:49:43 UTC
2018 aarch64 aarch64 aarch64 GNU/Linux

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list