Bug 27330 - nextoverthrow.exp FAILs on arm-none-eabi
Summary: nextoverthrow.exp FAILs on arm-none-eabi
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: breakpoints (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 10.2
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-03 08:53 UTC by Tom de Vries
Modified: 2021-11-24 13:43 UTC (History)
12 users (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 2021-02-03 08:53:48 UTC
Reported by Abid here ( https://sourceware.org/pipermail/gdb-patches/2021-February/175699.html ):
...
I observed that nextoverthrow.exp is now failing for many targets
including arm-none-eabi after this change.

> +      /* Iterate over separate debug objects and try an _Unwind_DebugHook
> +	 kind breakpoint.  */
> +      for (objfile *sepdebug = obj->separate_debug_objfile;
> +	   sepdebug != nullptr; sepdebug = sepdebug->separate_debug_objfile)
> +	if (create_exception_master_breakpoint_hook (sepdebug))
> +	  break;

This bit seems to be problematic as it is stopping exception breakpoint
to be installed when separate_debug_objfile is null.
...
Comment 1 Tom de Vries 2021-02-03 08:55:29 UTC
So, this is a regression since commit 1940319c0ef "[gdb] Fix internal-error in process_event_stop_test".

Tentative patch:
...
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index f318a125319..c20c0d7d649 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3625,11 +3625,10 @@ create_exception_master_breakpoint (void)
       if (create_exception_master_breakpoint_probe (obj))
        continue;
 
-      /* Iterate over separate debug objects and try an _Unwind_DebugHook
-        kind breakpoint.  */
-      for (objfile *sepdebug = obj->separate_debug_objfile;
-          sepdebug != nullptr; sepdebug = sepdebug->separate_debug_objfile)
-       if (create_exception_master_breakpoint_hook (sepdebug))
+      /* Iterate over main and separate debug objects and try an
+        _Unwind_DebugHook kind breakpoint.  */
+      for (objfile *debug_objfile : obj->separate_debug_objfiles ())
+       if (create_exception_master_breakpoint_hook (debug_objfile))
          break;
     }
 }

...
Comment 2 Tom de Vries 2021-02-03 09:57:02 UTC
The commit that introduced the regression was ported to gdb-10-branch, so the fix for this PR needs the same.

Setting target milestone to 10.2.
Comment 4 cvs-commit@gcc.gnu.org 2021-02-05 16:47:22 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=7c6944ab9bc4fd6e641c59f7c78ca4e1ec78fe7e

commit 7c6944ab9bc4fd6e641c59f7c78ca4e1ec78fe7e
Author: Tom de Vries <tdevries@suse.de>
Date:   Fri Feb 5 17:47:07 2021 +0100

    [gdb/breakpoints] Handle glibc with debuginfo in create_exception_master_breakpoint
    
    The test-case nextoverthrow.exp is failing on targets with unstripped libc.
    
    This is a regression since commit 1940319c0ef "[gdb] Fix internal-error in
    process_event_stop_test".
    
    The problem is that this code in create_exception_master_breakpoint:
    ...
          for (objfile *sepdebug = obj->separate_debug_objfile;
               sepdebug != nullptr; sepdebug = sepdebug->separate_debug_objfile)
            if (create_exception_master_breakpoint_hook (sepdebug))
    ...
    iterates over all the separate debug object files, but fails to handle the
    case that obj itself has the debug info we're looking for.
    
    Fix this by using the separate_debug_objfiles () range instead, which does
    iterate both over obj and the obj->separate_debug_objfile chain.
    
    Tested on x86_64-linux.
    
    gdb/ChangeLog:
    
    2021-02-05  Tom de Vries  <tdevries@suse.de>
    
            PR breakpoints/27330
            * breakpoint.c (create_exception_master_breakpoint): Handle case that
            glibc object file has debug info.
Comment 5 cvs-commit@gcc.gnu.org 2021-02-05 19:54:43 UTC
The gdb-10-branch branch has been updated by Tom de Vries <vries@sourceware.org>:

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

commit a1cf3cf35678691f6c3cb574b94e7f67be61d18d
Author: Tom de Vries <tdevries@suse.de>
Date:   Fri Feb 5 20:54:39 2021 +0100

    [gdb/breakpoints] Handle glibc with debuginfo in create_exception_master_breakpoint
    
    The test-case nextoverthrow.exp is failing on targets with unstripped libc.
    
    This is a regression since commit 1940319c0ef "[gdb] Fix internal-error in
    process_event_stop_test".
    
    The problem is that this code in create_exception_master_breakpoint:
    ...
          for (objfile *sepdebug = obj->separate_debug_objfile;
               sepdebug != nullptr; sepdebug = sepdebug->separate_debug_objfile)
            if (create_exception_master_breakpoint_hook (sepdebug))
    ...
    iterates over all the separate debug object files, but fails to handle the
    case that obj itself has the debug info we're looking for.
    
    Fix this by using the separate_debug_objfiles () range instead, which does
    iterate both over obj and the obj->separate_debug_objfile chain.
    
    Tested on x86_64-linux.
    
    gdb/ChangeLog:
    
    2021-02-05  Tom de Vries  <tdevries@suse.de>
    
            PR breakpoints/27330
            * breakpoint.c (create_exception_master_breakpoint): Handle case that
            glibc object file has debug info.
Comment 6 Tom de Vries 2021-02-05 19:55:50 UTC
Patch committed to trunk and gdb-10-branch, marking resolved-fixed.
Comment 7 Ahmed Sayeed 2021-06-27 17:44:40 UTC Comment hidden (spam)
Comment 8 james rohan 2021-09-02 11:06:35 UTC Comment hidden (spam)
Comment 9 Kim Olsun 2021-09-05 07:34:18 UTC Comment hidden (spam)
Comment 10 james robin 2021-09-06 09:08:53 UTC Comment hidden (spam)
Comment 11 Mehmet gelisin 2021-09-10 19:38:32 UTC Comment hidden (spam)
Comment 12 lisawelch939 2021-09-20 12:03:01 UTC Comment hidden (spam)
Comment 13 diheto 2021-09-22 10:19:55 UTC Comment hidden (spam)
Comment 14 Kylan 2021-09-26 13:31:48 UTC Comment hidden (spam)
Comment 15 Gulsen Engin 2021-10-09 11:00:31 UTC Comment hidden (spam)
Comment 16 studiaviktor 2021-10-09 17:03:42 UTC Comment hidden (spam)
Comment 17 Canerkin 2021-10-18 19:58:20 UTC Comment hidden (spam)
Comment 18 progonsaytu 2021-10-19 07:14:17 UTC Comment hidden (spam)
Comment 19 glassmtech 2021-10-24 10:02:14 UTC Comment hidden (spam)
Comment 20 LeoRVM 2021-11-24 13:43:04 UTC Comment hidden (spam)