[RFC,0/1] Add support for embedded source in GDB

Message ID 20240318162209.468831-1-hawkinsw@obs.cr
Headers
Series Add support for embedded source in GDB |

Message

Will Hawkins March 18, 2024, 4:22 p.m. UTC
  Hello everyone!

First, thank you for all that you do to keep gdb the best open-source debugger
available. I am a long-time user and minor contributor. This is my first
major-ish contribution.

Second, I know that cover letters are not generally encouraged but because this
patch is an RFC, I thought it would be a good opportunity to introduce the
patch's current status.

As it stands, DWARF has not finalized the DW_LNCT_source. However, LLVM does
emit it, when asked. It would be great if gdb supported it. This patch adds
support for the to-be-standardized version and the vendor extension that LLVM
currently uses.

If this is something that you think gdb would like to add, then I am happy to
continue cleaning up this patch by
- cleaning up the included test
- adding additional tests
- handling corner cases that I am sure you will discover.

I just wanted to pass this along early to get your sense of things.

I have attempted to follow all the coding guidelines and the best practices but
I know that I have probably fallen short. Again, if this is something that you
think you would like to see in gdb, I am 100% willing to learn from you and get
this into better shape.

No matter what, thank you again for all your volunteer work to keep gdb going.

Will

Will Hawkins (1):
  gdb: Support embedded source in DWARF

 gdb/dwarf2/line-header.c                     | 22 +++--
 gdb/dwarf2/line-header.h                     |  9 ++-
 gdb/dwarf2/read.c                            | 11 ++-
 gdb/source.c                                 | 73 ++++++++++++++++-
 gdb/source.h                                 |  4 +
 gdb/symtab.h                                 |  2 +
 gdb/testsuite/gdb.dwarf2/dw2-lnct-source.c   | 24 ++++++
 gdb/testsuite/gdb.dwarf2/dw2-lnct-source.exp | 85 ++++++++++++++++++++
 gdb/testsuite/lib/dwarf.exp                  | 14 +++-
 include/dwarf2.h                             |  2 +
 10 files changed, 227 insertions(+), 19 deletions(-)
 create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-lnct-source.c
 create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-lnct-source.exp
  

Comments

Tom Tromey March 18, 2024, 5:17 p.m. UTC | #1
>>>>> "Will" == Will Hawkins <hawkinsw@obs.cr> writes:

Will> Hello everyone!
Will> First, thank you for all that you do to keep gdb the best open-source debugger
Will> available. I am a long-time user and minor contributor. This is my first
Will> major-ish contribution.

Thanks.  I think you might as well get started on your copyright
assignment.  Email 'assign@gnu.org' and tell them you have gdb patches
to contribute; they will tell you what to do.  Be sure to let us know
when this is done.

Will> I just wanted to pass this along early to get your sense of things.

I don't have a problem with gdb supporting it.  I'll send some notes on
the patch.

Tom
  
Will Hawkins April 1, 2024, 7:18 p.m. UTC | #2
On Mon, Mar 18, 2024 at 1:17 PM Tom Tromey <tom@tromey.com> wrote:
>
> >>>>> "Will" == Will Hawkins <hawkinsw@obs.cr> writes:
>
> Will> Hello everyone!
> Will> First, thank you for all that you do to keep gdb the best open-source debugger
> Will> available. I am a long-time user and minor contributor. This is my first
> Will> major-ish contribution.
>
> Thanks.  I think you might as well get started on your copyright
> assignment.  Email 'assign@gnu.org' and tell them you have gdb patches
> to contribute; they will tell you what to do.  Be sure to let us know
> when this is done.

Just FYI: I have completed the copyright assignment. I am nearly done
with a v2 of this patch and I will send it as soon as possible!

Thanks for allowing me to contribute!
Will


>
> Will> I just wanted to pass this along early to get your sense of things.
>
> I don't have a problem with gdb supporting it.  I'll send some notes on
> the patch.
>
> Tom