[v2] Add DW_TAG_compile_unit DIE to Dummy CUs

Message ID 20240417165555.531273-1-hawkinsw@obs.cr
State New
Headers
Series [v2] Add DW_TAG_compile_unit DIE to Dummy CUs |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Will Hawkins April 17, 2024, 4:55 p.m. UTC
  Dummy CUs help detect errors and are very helpful. However, the DWARF
spec seems to indicate the CUs need a DW_TAG_compile_unit in addition to
the header. This patch adds that.

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

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
---
Notes:
    v1 -> v2
      - Add proper trailer to commit message noting the Bugzilla.

 gdb/testsuite/lib/dwarf.exp | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Tom de Vries April 18, 2024, 11:31 a.m. UTC | #1
On 4/17/24 18:55, Will Hawkins wrote:
> Dummy CUs help detect errors and are very helpful. However, the DWARF
> spec seems to indicate the CUs need a DW_TAG_compile_unit in addition to
> the header. This patch adds that.
> 

LGTM.

I've added tested-by and approved-by tags and pushed.

Thanks,
- Tom

> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31650
> 
> Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
> ---
> Notes:
>      v1 -> v2
>        - Add proper trailer to commit message noting the Bugzilla.
> 
>   gdb/testsuite/lib/dwarf.exp | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
> index c694375b534..1a97f83f8e6 100644
> --- a/gdb/testsuite/lib/dwarf.exp
> +++ b/gdb/testsuite/lib/dwarf.exp
> @@ -2999,6 +2999,7 @@ namespace eval Dwarf {
>       proc dummy_cu {} {
>   	# Generate a CU with default options and empty body.
>   	cu {label dummy_cu} {
> +	  compile_unit {}
>   	}
>   
>   	# Generate an .debug_aranges entry for the dummy CU.
  

Patch

diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index c694375b534..1a97f83f8e6 100644
--- a/gdb/testsuite/lib/dwarf.exp
+++ b/gdb/testsuite/lib/dwarf.exp
@@ -2999,6 +2999,7 @@  namespace eval Dwarf {
     proc dummy_cu {} {
 	# Generate a CU with default options and empty body.
 	cu {label dummy_cu} {
+	  compile_unit {}
 	}
 
 	# Generate an .debug_aranges entry for the dummy CU.