Bug 32235 - GDB 15.2 failed to debug on macOS Sequoia 15.0
Summary: GDB 15.2 failed to debug on macOS Sequoia 15.0
Status: UNCONFIRMED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-03 15:04 UTC by Victor Yeh
Modified: 2024-10-03 15:10 UTC (History)
0 users

See Also:
Host: macOS Sequoia 15.0 (24A335) - 2 GHz Quad-Core Intel Core i5
Target: macOS Sequoia 15.0 (24A335) - 2 GHz Quad-Core Intel Core i5
Build: macOS Sequoia 15.0 (24A335) - 2 GHz Quad-Core Intel Core i5
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Yeh 2024-10-03 15:04:02 UTC
I built an ordinary "Hello World" C program with gcc 14.2.0 on macOS Sequoia 15.0, and I ran perfectly, and it was debugged with lldb perfectly.

However, when I tried debugging it with gdb, it showed the error message `Dwarf Error: DW_FORM_line_strp used without required section`.

```
bash-3.2$ cat hello.c 
#include <stdio.h>

int main(void)
{
	printf("Hello World\n");
	return 0;
}
bash-3.2$ gcc-14 hello.c -o hello -Wall -O0 -ggdb
bash-3.2$ ./hello
Hello World
bash-3.2$ lldb ./hello
(lldb) target create "./hello"
Current executable set to '/Users/jianfeiye/test/ctest/hello' (x86_64).
(lldb) b main
Breakpoint 1: where = hello`main + 4 at hello.c:5:2, address = 0x0000000100000f88
(lldb) run
Process 49127 launched: '/Users/jianfeiye/test/ctest/hello' (x86_64)
Process 49127 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x0000000100000f88 hello`main at hello.c:5:2
   2   	
   3   	int main(void)
   4   	{
-> 5   		printf("Hello World\n");
   6   		return 0;
   7   	}
Target 0: (hello) stopped.
(lldb) n
Hello World
Process 49127 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
    frame #0: 0x0000000100000f97 hello`main at hello.c:6:9
   3   	int main(void)
   4   	{
   5   		printf("Hello World\n");
-> 6   		return 0;
   7   	}
Target 0: (hello) stopped.
(lldb) 
Process 49127 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
    frame #0: 0x0000000100000f9c hello`main at hello.c:7:1
   4   	{
   5   		printf("Hello World\n");
   6   		return 0;
-> 7   	}
Target 0: (hello) stopped.
(lldb) c
Process 49127 resuming
Process 49127 exited with status = 0 (0x00000000) 
(lldb) q
bash-3.2$ gdb ./hello
GNU gdb (GDB) 15.2
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin23.4.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./hello...
Reading symbols from /Users/jianfeiye/test/ctest/hello.dSYM/Contents/Resources/DWARF/hello...
(gdb) break main
Dwarf Error: DW_FORM_line_strp used without required section
(gdb) list 
Dwarf Error: DW_FORM_line_strp used without required section
(gdb) 

```
Comment 1 Victor Yeh 2024-10-03 15:10:19 UTC
Here is the version information.

```
bash-3.2$ uname -a
Darwin MacBookPro 24.0.0 Darwin Kernel Version 24.0.0: Mon Aug 12 20:54:30 PDT 2024; root:xnu-11215.1.10~2/RELEASE_X86_64 x86_64
bash-3.2$ gcc-14 --version
gcc-14 (Homebrew GCC 14.2.0) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

bash-3.2$ gdb --version
GNU gdb (GDB) 15.2
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
```