]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix MI -break-insert assertion failure (submit separately) (WIP)
authorPedro Alves <pedro@palves.net>
Wed, 9 Apr 2025 13:29:53 +0000 (14:29 +0100)
committerPedro Alves <pedro@palves.net>
Mon, 9 Jun 2025 17:09:18 +0000 (18:09 +0100)
commit9dcf67f0dae5f8f6cb387e253134d5634c7f0030
tree3232241a490e918bba85985045cb876599ec1974
parent29cc5fbfbcd7e730ec7f32d855acce950533524b
Fix MI -break-insert assertion failure (submit separately) (WIP)

TODO:
  - commit log
  - testcase

This is exposed by some pre-existing test.  Need to check which one it
was.

 (gdb) interpreter-exec mi "222-break-insert -g i100 foo"
 &"../../src/gdb/breakpoint.c:9165: internal-error: find_program_space_for_breakpoint: Assertion `inf != nullptr' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable."
 &"\n"
 &"----- Backtrace -----\n"
 &"Backtrace unavailable\n"
 &"---------------------\n"
 ~"../../src/gdb/breakpoint.c:9165: internal-error: find_program_space_for_breakpoint: Assertion `inf != nullptr' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\nQuit this debugging session? (y or n) "

From here:

 (top-gdb) bt
 #0  internal_error_loc (file=0x555556187e56 "../../src/gdb/breakpoint.c", line=9165, fmt=0x555556187bc8 "%s: Assertion `%s' failed.") at ../../src/gdbsupport/errors.cc:53
 #1  0x0000555555791a55 in find_program_space_for_breakpoint (thread=-1, inferior=100) at ../../src/gdb/breakpoint.c:9165
 #2  0x0000555555791f96 in create_breakpoint (gdbarch=0x5555568db900, locspec=0x5555567e7100, cond_string=0x0, thread=-1, inferior=100, extra_string=0x0, force_condition=false, parse_extra=0, tempflag=0, type_wanted=bp_breakpoint, ignore_count=0, pending_break_support=AUTO_BOOLEAN_FALSE, ops=0x555556642aa0 <code_breakpoint_ops>, from_tty=0, enabled=1, internal=0, flags=0) at ../../src/gdb/breakpoint.c:9275
 #3  0x0000555555bb9d15 in mi_cmd_break_insert_1 (dprintf=0, command=0x5555567e6fd0 "break-insert", argv=0x5555567e7070, argc=3) at ../../src/gdb/mi/mi-cmd-break.c:366
 #4  0x0000555555bb9e15 in mi_cmd_break_insert (command=0x5555567e6fd0 "break-insert", argv=0x5555567e7070, argc=3) at ../../src/gdb/mi/mi-cmd-break.c:383
 ...

Change-Id: Ibde0d4d098bf0b5d7b057e818a77a63c84806a3c
gdb/inferior.c
gdb/inferior.h
gdb/mi/mi-cmd-break.c