Bug 25011 - Breakpoints on file reloads broken for PIE binaries
Summary: Breakpoints on file reloads broken for PIE binaries
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: breakpoints (show other bugs)
Version: 8.3
: P2 normal
Target Milestone: 8.3.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 25014 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-09-18 14:25 UTC by Tom de Vries
Modified: 2019-10-13 13:09 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom de Vries 2019-09-18 14:25:29 UTC
When a binary is built using PIE, reloading the file will cause GDB to error                                      
on restart.  For example:                                                                                         
gdb ./a.out                                                                                                       
(gdb) break main                                                                                                  
(gdb) run                                                                                                         
(gdb) file ./a.out                                                                                                
(gdb) continue                                                                                                    
                                                                                                                  
Will cause GDB to error with:                                                                                     
Continuing.                                                                                                       
Warning:                                                                                                          
Cannot insert breakpoint 1.                                                                                       
Cannot access memory at address 0x9e0                                                                             
Command aborted.                                                                                                  
                                                                                                                  
This is due to the symbol offsets not being relocated after reloading the file.
Comment 1 Sourceware Commits 2019-09-18 20:40:19 UTC
The gdb-8.3-branch branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=88f07f28d5b2e0cd0f322dd461aaaeaee8e77758

commit 88f07f28d5b2e0cd0f322dd461aaaeaee8e77758
Author: Tom de Vries <tdevries@suse.de>
Date:   Wed Sep 18 22:39:39 2019 +0200

    Update ChangeLog entry of commit 7e38ddcb2e and mention PR breakpoints/25011
Comment 2 Tom de Vries 2019-09-18 20:41:12 UTC
Fix backported, marking resolved-fixed.
Comment 3 Alan Hayward 2019-09-19 14:38:39 UTC
*** Bug 25014 has been marked as a duplicate of this bug. ***
Comment 4 Sourceware Commits 2019-10-13 13:09:55 UTC
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5862c886a2af3f7b0ac14e95d7733ccb4183ce62

commit 5862c886a2af3f7b0ac14e95d7733ccb4183ce62
Author: Tom de Vries <tdevries@suse.de>
Date:   Sun Oct 13 15:09:09 2019 +0200

    Mention PR breakpoints/25011 in ChangeLog entry
    
    [ Port of gdb-8.3-branch commit 88f07f28d5b "Update ChangeLog entry of commit
    7e38ddcb2e and mention PR breakpoints/25011". ]