unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Niall Ryan <niall.christopher.ryan@gmail.com>
To: 48731@debbugs.gnu.org
Subject: bug#48731: 26.3; GDB doesn't draw breakpoints with <MULTIPLE> addresses/locations
Date: Sat, 29 May 2021 17:54:07 +0100	[thread overview]
Message-ID: <d1a7a602-c59f-a754-89c0-cd8aa721fffb@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2593 bytes --]

------
Bug Description:

Issue:
'gdb' with gdb-many-windows, fails to draw breakpoints in the bar

on the left of each window if the gdb breakpoint has <MULTIPLE>
addresses/multiple locations.

<MULTIPLE> addresses can occur if a shared library breakpoint is set.

The issue appears to manifest in the function gdb-place-breakpoints()

- For each breakpoint, the function uses
        (bindat-get-field breakpoint 'line)
   to determine the linenumber of the breakpoint
- However, this fails for breakpoints as the line field (if
   present), is at a lower level of the list tree, in one of the items in
   the sublist "locations"

Example:

Note: I am creating these breakpoints as follows. On gdb
startup, the shared library symbols are loaded and set with:
- add-symbol-file -readnow handmade.so
- b handmade.cpp:224
The breakpoint will initially be drawn in the relevant buffer

The value of gdb-breakpoint-list is at first:

((#1="1"
(number . #1#)
(type . "breakpoint")
(disp . "keep")
(enabled . "y")
(addr . "0x000000000000c168")
(func . "GameUpdateAndRender(game_memory*, game_input*, 
game_render_commands*)")
(file . "../cpp/code/handmade.cpp")
(fullname . "/home/niall/software/handmadehero/sdl/cpp/code/handmade.cpp")
(line . "224")
(thread-groups "i1")
(times . "0")
(original-location . "handmade.cpp:224")))

(bindat-get-field breakpoint 'line) initially succeeds and the
breakpoint is drawn.


However, on running the program, once the shared library is actually

loaded, the value of gdb-breakpoint-list becomes


((#1="1"
(number . #1#)
(type . "breakpoint")
(disp . "keep")
(enabled . "y")
(addr . "")
(times . "1")
(original-location . "handmade.cpp:224")
(locations
((number . "1.1")
(enabled . "y")
(addr . "")
(pending . "handmade.cpp:224")
(thread-groups "i1"))
((number . "1.2")
(enabled . "y")
(addr . "0x00007ffff7f4e168")
(func . "GameUpdateAndRender(game_memory*, game_input*, 
game_render_commands*)")
(file . "../cpp/code/handmade.cpp")
(fullname . "/home/niall/software/handmadehero/sdl/cpp/code/handmade.cpp")
(line . "224")
(thread-groups "i1")))))

And (bindat-get-field breakpoint 'line) fails,
and the breakpoint is no longer drawn (it is initially wiped in 
gdb-place-breakpoints)

I hope this helps someone.

Niall

P.S.

I am not well expierienced with lisp, so apologies for any terminology 
errors.

-----------------------------End Bug description-------




In GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14)
of 2020-03-26, modified by Debian built on lcy01-amd64-020
Windowing system distributor 'The X.Org Foundation

[-- Attachment #2: Type: text/html, Size: 6103 bytes --]

                 reply	other threads:[~2021-05-29 16:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d1a7a602-c59f-a754-89c0-cd8aa721fffb@gmail.com \
    --to=niall.christopher.ryan@gmail.com \
    --cc=48731@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).