[Bug mi/34501] New: gdb responds with corrupt output on trying to inserting a breakpoint

"jarmo.tiitto at gmail dot com via Gdb-prs" <[email protected]>
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=34501

            Bug ID: 34501
           Summary: gdb responds with corrupt output on trying to
                    inserting a breakpoint
           Product: gdb
           Version: 17.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: mi
          Assignee: unassigned at sourceware dot org
          Reporter: jarmo.tiitto at gmail dot com
  Target Milestone: ---

Created attachment 16917
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16917&action=edit
Erroreous output from gdb --interpreter=mi2 -quiet

gcc (GCC) 16.1.1 20260728
GNU gdb (GDB) 17.2 (built from source using above compiler)

I previously asked about this bug in
https://sourceware.org/bugzilla/show_bug.cgi?id=32571 which looked very similar
to it, but we determined this is a separate issue.

GDB erroneously prints "&"�\235\214�\217 " which is the common sign of a bug. I
have yet have GDB crash to this, but the erroneous output affects all tools
that would consume or parse GDB's output in MI mode.

Interestingly, my old workaround of building GDB without LTO no longer prevents
the bug.
There were a few build warning generated at right end of the non-LTO build:

    inlined from ‘void info_sources_worker(ui_out*, bool, const
info_sources_filter&)’ at ../../gdb/symtab.c:4796:1:
../../gdb/ui-out.h:417:18: warning:
‘*(ui_out_emit_type<ui_out_type_tuple>*)((char*)&output_tuple +
offsetof(std::optional<ui_out_emit_type<ui_out_type_tuple>
>,std::optional<ui_out_emit_type<ui_out_type_tuple>
>::<unnamed>.std::_Optional_base<ui_out_emit_type<ui_out_type_tuple>, false,
false>::_M_payload.std::_Optional_payload<ui_out_emit_type<ui_out_type_tuple>,
false, false,
false>::<unnamed>.std::_Optional_payload<ui_out_emit_type<ui_out_type_tuple>,
true, false,
false>::<unnamed>.std::_Optional_payload_base<ui_out_emit_type<ui_out_type_tuple>
>::_M_payload)).ui_out_emit_type<ui_out_type_tuple>::m_uiout’ may be used
uninitialized [-Wmaybe-uninitialized]

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.