public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug rust/26148] New: Unable to break within rust source code
@ 2020-06-22 10:26 summers.ryan.m at gmail dot com
  2020-06-22 13:04 ` [Bug rust/26148] " summers.ryan.m at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: summers.ryan.m at gmail dot com @ 2020-06-22 10:26 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26148

            Bug ID: 26148
           Summary: Unable to break within rust source code
           Product: gdb
           Version: 9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: rust
          Assignee: unassigned at sourceware dot org
          Reporter: summers.ryan.m at gmail dot com
  Target Milestone: ---

When using gdb-multiarch to debug an embedded Rust target, GDB may fail to set
breakpoints when specifying source code lines.

A demonstration project has been created at
https://github.com/ryan-summers/rust-rtic-gdb-bug to reproduce the bug. When
attempting to set a breakpoint within the src/main.rs file using `b
main.rs:38`, a breakpoint is instead created at `main.rs:49`.


> Breakpoint 1 at 0x80006cc: file /home/ryan/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.6.12/src/lib.rs, line 562.
> Breakpoint 2 at 0x8002846: file src/main.rs, line 49.
> Breakpoint 3 at 0x8002552: file /home/ryan/.cargo/registry/src/github.com-1ecc6299db9ec823/panic-halt-0.2.0/src/lib.rs, line 32.
> Loading section .vector_table, size 0x298 lma 0x8000000
> Loading section .text, size 0x25d0 lma 0x8000298
> Loading section .rodata, size 0xebc lma 0x8002868
> Start address 0x08000664, load size 14116
> Transfer rate: 12 KB/sec, 4705 bytes/write.
> target halted due to debug-request, current mode: Thread 
> xPSR: 0x01000000 pc: 0x08000664 msp: 0x20020000, semihosting
> (gdb) b main.rs:38
> Note: breakpoint 2 also set at pc 0x8002846.
> Breakpoint 4 at 0x8002846: file src/main.rs, line 49.
> (gdb) 


When the rust source at
https://github.com/ryan-summers/rust-rtic-gdb-bug/blob/4a6cb53c0f4a2bb1c4e1c998246db007dc68621a/src/main.rs#L26

is changed from
```
        test_object: Container<Object<'static>,>,
```
to
```
        test_object: Container<Object<'static>>,
```

GDB is again able to set breakpoints within the `main.rs` file.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug rust/26148] Unable to break within rust source code
  2020-06-22 10:26 [Bug rust/26148] New: Unable to break within rust source code summers.ryan.m at gmail dot com
@ 2020-06-22 13:04 ` summers.ryan.m at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: summers.ryan.m at gmail dot com @ 2020-06-22 13:04 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26148

Ryan Summers <summers.ryan.m at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Ryan Summers <summers.ryan.m at gmail dot com> ---
Upon investigation of the output ELF files generated by the rust compiler, it
was observed that this is likely caused by invalid debug information generated
by rust. The `.debug_lines` section is shorter in the case with a trailing
comma in the type signature, which indicates the rust compiler is emitting
invalid debug info for GDB.

 The associated compiler issue is documented here:
https://github.com/rust-lang/rust/issues/43081

I'm resolving this for now as I don't believe it's related to GDB directly
anymore.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-22 13:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-22 10:26 [Bug rust/26148] New: Unable to break within rust source code summers.ryan.m at gmail dot com
2020-06-22 13:04 ` [Bug rust/26148] " summers.ryan.m at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).