From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AC6463858D37; Mon, 26 Dec 2022 20:14:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC6463858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1672085699; bh=aarGNlJLn2zuIxg6uJ9yq+4peg8otVfieAKV5WNAp1s=; h=From:To:Subject:Date:From; b=PReVI8WVkGmrHXtLAeyeYwEUfXyBC0d3GHEa8C6FZNqdvBpINWJ2g95rGOEo5c6kA nNAhZenuLA4XEb95bXNaTQJhHqqBUYV6SnGyqgU01ty940q26By792eAMUWL1+QpyJ QQs0sWwJn7hk7f5gn9OXN8ybNKGz4sw5UoYbHJAg= From: "pauldfaria at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/29943] New: Gdb assertion failure on `layout reg general` for armv6-m source compiled from .S Date: Mon, 26 Dec 2022 20:14:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 12.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pauldfaria at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29943 Bug ID: 29943 Summary: Gdb assertion failure on `layout reg general` for armv6-m source compiled from .S Product: gdb Version: 12.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: pauldfaria at gmail dot com Target Milestone: --- Gdb assertion triggered when trying to view registers in tui mode for arm assembly program compiled from .S file. The assembly is intended for cortex-m0plus, thumb format. To repro: 1. Use file hello-world.S: ``` .syntax unified .thumb .text .global _start .thumb_func _start: bkpt ``` 2. run `arm-none-eabi-gcc -E hello-world.S > hello-world.s` 3. run `arm-none-eabi-as -mcpu=3Dcortex-m0plus -mthumb -gstabs -o hello-wo= rld.o hello-world.s` 4. run `arm-none-eabi-ld hello-world.o -o hello-world` 5. run `qemu-arm-static -cpu cortex-m0 -g 10101 hello-world` 6. In another terminal run: ``` gdb-multiarch -q \ -ex "set confirm off" \ -ex "file hello-world" \ -ex "target remote localhost:10101" \ -ex "set confirm on" ``` 7. In the gdb prompt, type `tui reg general`. Expected result: 1. Should see register values Actual result: 1. Assertion triggered, rendering broken. See images at github repo linked below 2. After entering `y` at the Create core file prompt: ``` Create a core file of GDB? (y or n) yAborted (core dumped) --------------------- make: ***=20 ``` Core file attached to this bug. Github repository with makefile setup for reproduction available at https://github.com/Nashenas88/gdb-multiarch-bug Version information: ``` $ uname -a Linux pop-os 6.0.6-76060006-generic #202210290932~1669062050~22.04~d94609a = SMP PREEMPT_DYNAMIC Mon N x86_64 x86_64 x86_64 GNU/Linux ``` apt deps: `sudo apt install qemu-user-static gdb-multiarch gcc-arm-linux-gnueabihf` ``` $ arm-none-eabi-gcc --version arm-none-eabi-gcc (15:10.3-2021.07-4) 10.3.1 20210621 (release) Copyright (C) 2020 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. ``` ``` $ arm-none-eabi-as --version GNU assembler (2.38-3ubuntu1+15build1) 2.38 Copyright (C) 2022 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or later. This program has absolutely no warranty. This assembler was configured for a target of `arm-none-eabi'. ``` ``` $ arm-none-eabi-ld --version GNU ld (2.38-3ubuntu1+15build1) 2.38 Copyright (C) 2022 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later versio= n. This program has absolutely no warranty. ``` ``` $ qemu-arm-static --version qemu-arm version 6.2.0 (Debian 1:6.2+dfsg-2ubuntu6.6) Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers ``` ``` $ gdb-multiarch --version GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1 Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. $ gdb-multiarch --configuration This GDB was configured as follows: configure --host=3Dx86_64-linux-gnu --target=3Dx86_64-linux-gnu --with-auto-load-dir=3D$debugdir:$datadir/auto-load --with-auto-load-safe-path=3D$debugdir:$datadir/auto-load --with-expat --with-gdb-datadir=3D/usr/share/gdb (relocatable) --with-jit-reader-dir=3D/usr/lib/gdb (relocatable) --without-libunwind-ia64 --with-lzma --with-babeltrace --with-intel-pt --with-mpfr --with-xxhash --with-python=3D/usr (relocatable) --with-python-libdir=3D/usr/lib (relocatable) --with-debuginfod --without-guile --enable-source-highlight --with-separate-debug-dir=3D/usr/lib/debug (relocatable) --with-system-gdbinit=3D/etc/gdb/gdbinit --with-system-gdbinit-dir=3D/etc/gdb/gdbinit.d ("Relocatable" means the directory can be moved with the GDB installation tree, and GDB will still find it.) ``` Contents of `~/.gdbinit`: ``` tui new-layout arm {-horizontal asm 1 regs 1} 2 status 0 cmd 1 set auto-load safe-path / ``` # Possible clue? The issue seems to come from the `#` lines generated by compilation of the = `.s` file from the `.S` file. If I remove the `#` lines from the `.s` file, the error stops occurring. --=20 You are receiving this mail because: You are on the CC list for the bug.=