From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Niall Ryan Newsgroups: gmane.emacs.bugs Subject: bug#48731: 26.3; GDB doesn't draw breakpoints with addresses/locations Date: Sat, 29 May 2021 17:54:07 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------6745F2D649F1C3248B2D5B90" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31819"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.7.1 To: 48731@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 29 19:16:32 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ln2Zb-00083m-QI for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 May 2021 19:16:31 +0200 Original-Received: from localhost ([::1]:51132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ln2Za-0001xF-Sv for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 May 2021 13:16:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ln2Z8-0001uu-TE for bug-gnu-emacs@gnu.org; Sat, 29 May 2021 13:16:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46100) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ln2Z8-0002OY-KA for bug-gnu-emacs@gnu.org; Sat, 29 May 2021 13:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ln2Z8-0001hF-Fo for bug-gnu-emacs@gnu.org; Sat, 29 May 2021 13:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Niall Ryan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 May 2021 17:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48731 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16223085446492 (code B ref -1); Sat, 29 May 2021 17:16:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 May 2021 17:15:44 +0000 Original-Received: from localhost ([127.0.0.1]:57646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ln2Yp-0001gd-CK for submit@debbugs.gnu.org; Sat, 29 May 2021 13:15:44 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:53636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ln2E1-00018q-Ca for submit@debbugs.gnu.org; Sat, 29 May 2021 12:54:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ln2E1-00080U-3e for bug-gnu-emacs@gnu.org; Sat, 29 May 2021 12:54:13 -0400 Original-Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:43789) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ln2Dz-0004a1-7a for bug-gnu-emacs@gnu.org; Sat, 29 May 2021 12:54:12 -0400 Original-Received: by mail-wr1-x42f.google.com with SMTP id v23so4004843wrd.10 for ; Sat, 29 May 2021 09:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:subject:from:message-id:date:user-agent:mime-version :content-language; bh=x5XyQwTsqb28pRfQblgg+2/pBHfbuEa2/JY1uWvk1dw=; b=fVZ/mnKMU77FrqfY3WM06dVZWY8xb2G0hCVW7GFMbIHVNOOS8cXbRT8kj0OZCXxhLb gyvl47pO6bjyk3JtZrNqEoU+qhZwPdrjwxvYY34U/ZLvUrLm3+jkM0whgSntW0UdGuKp sP6xODHkt/v2Fcz+Ctj0Y+kjUQnFEmeBR/IMNxGWSgpdnJwZPQicOOTuK1EdNr7jelDf 7VhwFjbahYNBYFCnMR4NjBQwfpIK8F6T39EfumCYjVdxO2pYBQVqHpm96v3zuyTaU/mC DrnwF7ig7dwWHzv0WtzugCQ5u/v372h4wqxQ/JRIQ8L0ff5x795IX7CzECsKtIJTQnP0 Sx1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:from:message-id:date:user-agent :mime-version:content-language; bh=x5XyQwTsqb28pRfQblgg+2/pBHfbuEa2/JY1uWvk1dw=; b=bLzxd5n6Ok+LjS5oMPa07iyM75xG3HEmYhMZGnVdddZeruRZYk0DfusdU6CYLIw5Bt 9M5qkWk9MDpqLxKuDOPV3m1zgyt5jRKAXTsTmr3yi4H4FOB36Auf0JKy6/ISq9TwT2Pt 0FuVxub473Kjoz+KcjWOo36YgpRP/LDI0D/J9TR1jfG2sdX1/vpJPRY9ixoJ/lewK2rO dDOnSaythLey9/NdWdnOFtVFW/a+SUkM/OPRny23Mq7VkPK9Un8G20syWt3eMPCX6QhC jFAbjWnFhELiTNa1AvX0co7isx9UjHnhOWNvtqFRrkU3ddcJXYMWqtjfxx1oPspNRpdl Knnw== X-Gm-Message-State: AOAM5335ujt7FfiR+044EKLZzgkVuFBdERAmO9LTDjU8vTykV/gDQxcu /Cn7Bq2y3/HZA4EKC6Tb6/Od4UvMIes= X-Google-Smtp-Source: ABdhPJxoa/2iceVpQaFThhY5pfRBsTszweTxZ3ZdTaGHQAsNLC/2PR8MtTBalmmchj6KwV3v6yb1tg== X-Received: by 2002:a5d:56d1:: with SMTP id m17mr14729803wrw.164.1622307249442; Sat, 29 May 2021 09:54:09 -0700 (PDT) Original-Received: from [192.168.2.105] ([84.203.31.25]) by smtp.gmail.com with ESMTPSA id p10sm10166275wrr.58.2021.05.29.09.54.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 29 May 2021 09:54:08 -0700 (PDT) Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=niall.christopher.ryan@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 29 May 2021 13:15:42 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:207546 Archived-At: This is a multi-part message in MIME format. --------------6745F2D649F1C3248B2D5B90 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit ------ 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 addresses/multiple locations. 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 --------------6745F2D649F1C3248B2D5B90 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit ------
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
--------------6745F2D649F1C3248B2D5B90--