public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug build/30488] New: [gdb/build] Code guarded with HANDLE_MULTIBYTE is dead
@ 2023-05-25 11:48 vries at gcc dot gnu.org
  2023-05-25 11:49 ` [Bug build/30488] " vries at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2023-05-25 11:48 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30488
           Summary: [gdb/build] Code guarded with HANDLE_MULTIBYTE is dead
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

I noticed a use of HANDLE_MULTIBYTE in gdb:
...
./gdb/completer.c:#if defined (HANDLE_MULTIBYTE)
./gdb/completer.c:#if defined (HANDLE_MULTIBYTE)
./gdb/completer.c:#if defined (HANDLE_MULTIBYTE)
./gdb/completer.c:#if defined (HANDLE_MULTIBYTE)
./gdb/completer.c:#if defined (HANDLE_MULTIBYTE)
./gdb/completer.c:#if defined (HANDLE_MULTIBYTE)
./gdb/completer.c:#if defined (HANDLE_MULTIBYTE)
...
while the macro seems to be defined in readline:
...
./readline/readline/rlmbutil.h:#    define HANDLE_MULTIBYTE      1
...

I first looked at system readline.

It seems that the library is build with multi-byte support:
...
$ nm -D /lib64/libreadline.so.7.0 | grep mbrtowc
                 U mbrtowc
...

But in the exported header files the macro is not set in any way:
...
$ find /usr/include/readline/ -type f | xargs grep HANDLE_MULTIBYTE
$
...

I then tried without system readline, and build gdb with this patch:
...
diff --git a/gdb/completer.c b/gdb/completer.c
index 91a29daee36..62bd87cc939 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -2435,6 +2435,7 @@ get_max_completions_reached_message (void)
 #undef VISIBLE_STATS

 #if defined (HANDLE_MULTIBYTE)
+#error bla
 #define MB_INVALIDCH(x) ((x) == (size_t)-1 || (x) == (size_t)-2)
 #define MB_NULLWCH(x)   ((x) == 0)
 #endif
...
which build fine.

So, in both cases HANDLE_MULTIBYTE is undefined, and the code guarded by it is
currently dead.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug build/30488] [gdb/build] Code guarded with HANDLE_MULTIBYTE is dead
  2023-05-25 11:48 [Bug build/30488] New: [gdb/build] Code guarded with HANDLE_MULTIBYTE is dead vries at gcc dot gnu.org
@ 2023-05-25 11:49 ` vries at gcc dot gnu.org
  2023-08-28 13:50 ` tromey at sourceware dot org
  2023-08-28 14:23 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2023-05-25 11:49 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Overview of all files in the repo referencing HANDLE_MULTIBYTE:
...
$ find . -type f | egrep -v "\.git" | xargs grep -l "HANDLE_MULTIBYTE"
./gnulib/ChangeLog
./readline/readline/mbutil.c
./readline/readline/kill.c
./readline/readline/vi_mode.c
./readline/readline/complete.c
./readline/readline/rlprivate.h
./readline/readline/histexpand.c
./readline/readline/CHANGELOG
./readline/readline/display.c
./readline/readline/text.c
./readline/readline/ChangeLog.gdb
./readline/readline/isearch.c
./readline/readline/search.c
./readline/readline/util.c
./readline/readline/input.c
./readline/readline/rlmbutil.h
./gdb/completer.c
...

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug build/30488] [gdb/build] Code guarded with HANDLE_MULTIBYTE is dead
  2023-05-25 11:48 [Bug build/30488] New: [gdb/build] Code guarded with HANDLE_MULTIBYTE is dead vries at gcc dot gnu.org
  2023-05-25 11:49 ` [Bug build/30488] " vries at gcc dot gnu.org
@ 2023-08-28 13:50 ` tromey at sourceware dot org
  2023-08-28 14:23 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: tromey at sourceware dot org @ 2023-08-28 13:50 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
This sounds like something to ask the readline developers about...?

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug build/30488] [gdb/build] Code guarded with HANDLE_MULTIBYTE is dead
  2023-05-25 11:48 [Bug build/30488] New: [gdb/build] Code guarded with HANDLE_MULTIBYTE is dead vries at gcc dot gnu.org
  2023-05-25 11:49 ` [Bug build/30488] " vries at gcc dot gnu.org
  2023-08-28 13:50 ` tromey at sourceware dot org
@ 2023-08-28 14:23 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2023-08-28 14:23 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom Tromey from comment #2)
> This sounds like something to ask the readline developers about...?

I wouldn't know what to ask. My understanding of the problem is limited to gdb
having dead code.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-28 14:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-25 11:48 [Bug build/30488] New: [gdb/build] Code guarded with HANDLE_MULTIBYTE is dead vries at gcc dot gnu.org
2023-05-25 11:49 ` [Bug build/30488] " vries at gcc dot gnu.org
2023-08-28 13:50 ` tromey at sourceware dot org
2023-08-28 14:23 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).