public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/27306] New: macro definition not found except when using -a
@ 2021-02-01 10:40 mpoulhies at kalray dot eu
  2021-02-01 10:41 ` [Bug gdb/27306] " mpoulhies at kalray dot eu
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: mpoulhies at kalray dot eu @ 2021-02-01 10:40 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 27306
           Summary: macro definition not found except when using -a
           Product: gdb
           Version: 10.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: mpoulhies at kalray dot eu
  Target Milestone: ---

Created attachment 13186
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13186&action=edit
objdump -g test.o (gcc version)

We have ported both GCC and CLANG for a proprietary processor.
Macro debugging with GCC works correctly, but not with CLANG.

Looking a DWARF dumps does not show any problem (at least not for me).

Applying this little patch fixes our issue :
8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----
diff --git a/gdb/macroscope.c b/gdb/macroscope.c
index 3b02c97528e..ac906c6ecdb 100644
--- a/gdb/macroscope.c
+++ b/gdb/macroscope.c
@@ -52,6 +52,9 @@ sal_macro_scope (struct symtab_and_line sal)
   main_file = macro_main (COMPUNIT_MACRO_TABLE (cust));
   inclusion = macro_lookup_inclusion (main_file, sal.symtab->filename);

+  if (!inclusion)
+    inclusion = macro_lookup_inclusion (main_file, sal.symtab->fullname);
+
   if (inclusion)
     {
       ms->file = inclusion;
8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----

But that may not be the correct fix for our problem.

For some reason, main_file is the full path and GDB compares it to ->filename
which is only the last component of the full path. Adding an extra comparison
with ->fullname allows GDB to match it as expected.

Example source used:
8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----
#define SUM(a, b) a+b

int main()
{
  int a=SUM(1,2);
  return a;
}
8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----

The code emitted by GCC 7 (-gdwarf-4 -g3) works without modifying GDB:

8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----
kvx-gdb ./test.gcc
GNU gdb (GDB) 10.1
Kalray gdb version 4.4.0-6.unstable.0497f39.coolidge.dirty 0497f395-dirty
Copyright (C) 2020 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 "--host=x86_64-pc-linux-gnu --target=kvx-elf".
Type "show configuration" for configuration details.
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 ./test.gcc...
(gdb) b main
Breakpoint 1 at 0x19f64: file ../test.c, line 5.
(gdb) r
Starting program: /work1/mpoulhies/scratch/T15367_dwarf_clang/dw4/test.gcc

Thread 2 "PE 0 of Cluster0 (mppa 0; board 0)" hit Breakpoint 1, main () at
../test.c:5
5         int a=SUM(1,2);
(gdb) list
1       #define SUM(a, b) a+b
2
3       int main()
4       {
5         int a=SUM(1,2);
6         return a;
7       }
(gdb) info macro SUM
Defined at /work1/mpoulhies/scratch/T15367_dwarf_clang/dw4/../test.c:1
#define SUM(a, b) a+b
(gdb) quit
A debugging session is active.

        Inferior 1 [process 1] will be killed.
8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----

8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----
test.o:     file format elf64-kvx

Contents of the .debug_info section (loaded from test.o):

  Compilation Unit @ offset 0x0:
   Length:        0x63 (32-bit)
   Version:       4
   Abbrev Offset: 0x0
   Pointer Size:  8
 <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <c>   DW_AT_producer    : (indirect string, offset: 0x210): GNU C11 7.5.0
-gdwarf-4 -g3
    <10>   DW_AT_language    : 12       (ANSI C99)
    <11>   DW_AT_name        : (indirect string, offset: 0x5eb): test.c
    <15>   DW_AT_comp_dir    : (indirect string, offset: 0x3d5):
/work1/mpoulhies/scratch/T15367_dwarf_clang/dw4/retest/gcc
    <19>   DW_AT_low_pc      : 0x0
    <21>   DW_AT_high_pc     : 0x18
    <29>   DW_AT_stmt_list   : 0x0
    <2d>   DW_AT_GNU_macros  : 0x0
 <1><31>: Abbrev Number: 2 (DW_TAG_subprogram)
    <32>   DW_AT_external    : 1
    <32>   DW_AT_name        : (indirect string, offset: 0x1f48): main
    <36>   DW_AT_decl_file   : 1
    <37>   DW_AT_decl_line   : 3
    <38>   DW_AT_type        : <0x5f>
    <3c>   DW_AT_low_pc      : 0x0
    <44>   DW_AT_high_pc     : 0x18
    <4c>   DW_AT_frame_base  : 1 byte block: 9c         (DW_OP_call_frame_cfa)
    <4e>   DW_AT_GNU_all_call_sites: 1
    <4e>   DW_AT_sibling     : <0x5f>
 <2><52>: Abbrev Number: 3 (DW_TAG_variable)
    <53>   DW_AT_name        : a
    <55>   DW_AT_decl_file   : 1
    <56>   DW_AT_decl_line   : 5
    <57>   DW_AT_type        : <0x5f>
    <5b>   DW_AT_location    : 2 byte block: 91 7c      (DW_OP_fbreg: -4)
 <2><5e>: Abbrev Number: 0
 <1><5f>: Abbrev Number: 4 (DW_TAG_base_type)
    <60>   DW_AT_byte_size   : 4
    <61>   DW_AT_encoding    : 5        (signed)
    <62>   DW_AT_name        : int
 <1><66>: Abbrev Number: 0

Contents of the .debug_abbrev section (loaded from test.o):

  Number TAG (0x0)
   1      DW_TAG_compile_unit    [has children]
    DW_AT_producer     DW_FORM_strp
    DW_AT_language     DW_FORM_data1
    DW_AT_name         DW_FORM_strp
    DW_AT_comp_dir     DW_FORM_strp
    DW_AT_low_pc       DW_FORM_addr
    DW_AT_high_pc      DW_FORM_data8
    DW_AT_stmt_list    DW_FORM_sec_offset
    DW_AT_GNU_macros   DW_FORM_sec_offset
    DW_AT value: 0     DW_FORM value: 0
   2      DW_TAG_subprogram    [has children]
    DW_AT_external     DW_FORM_flag_present
    DW_AT_name         DW_FORM_strp
    DW_AT_decl_file    DW_FORM_data1
    DW_AT_decl_line    DW_FORM_data1
    DW_AT_type         DW_FORM_ref4
    DW_AT_low_pc       DW_FORM_addr
    DW_AT_high_pc      DW_FORM_data8
    DW_AT_frame_base   DW_FORM_exprloc
    DW_AT_GNU_all_call_sites DW_FORM_flag_present
    DW_AT_sibling      DW_FORM_ref4
    DW_AT value: 0     DW_FORM value: 0
   3      DW_TAG_variable    [no children]
    DW_AT_name         DW_FORM_string
    DW_AT_decl_file    DW_FORM_data1
    DW_AT_decl_line    DW_FORM_data1
    DW_AT_type         DW_FORM_ref4
    DW_AT_location     DW_FORM_exprloc
    DW_AT value: 0     DW_FORM value: 0
   4      DW_TAG_base_type    [no children]
    DW_AT_byte_size    DW_FORM_data1
    DW_AT_encoding     DW_FORM_data1
    DW_AT_name         DW_FORM_string
    DW_AT value: 0     DW_FORM value: 0

Contents of the .debug_aranges section (loaded from test.o):

  Length:                   44
  Version:                  2
  Offset into .debug_info:  0x0
  Pointer Size:             8
  Segment Size:             0

    Address            Length
    0000000000000000 0000000000000018
    0000000000000000 0000000000000000

Contents of the .debug_macro section (loaded from test.o):

  Offset:                      0x0
  Version:                     4
  Offset size:                 4
  Offset into .debug_line:     0x0

 DW_MACRO_import - offset : 0x0
 DW_MACRO_start_file - lineno: 0 filenum: 1 filename: test.c
 DW_MACRO_define_strp - lineno : 1 macro : SUM(a,b) a+b
 DW_MACRO_end_file

Contents of the .debug_macro section (loaded from test.o):

  Offset:                      0x0
  Version:                     4
  Offset size:                 4

 DW_MACRO_define_strp - lineno : 0 macro : __STDC__ 1
 DW_MACRO_define_strp - lineno : 0 macro : __STDC_VERSION__ 201112L
 DW_MACRO_define_strp - lineno : 0 macro : __STDC_UTF_16__ 1
 DW_MACRO_define_strp - lineno : 0 macro : __STDC_UTF_32__ 1
 DW_MACRO_define_strp - lineno : 0 macro : __STDC_HOSTED__ 1
 DW_MACRO_define_strp - lineno : 0 macro : __GNUC__ 7
 DW_MACRO_define_strp - lineno : 0 macro : __GNUC_MINOR__ 5
...
 DW_MACRO_define_strp - lineno : 0 macro : __CLUSTER_OS__ 1
 DW_MACRO_define_strp - lineno : 0 macro : __ELF__ 1

Raw dump of debug contents of section .debug_line (loaded from test.o):

  Offset:                      0x0
  Length:                      55
  DWARF Version:               3
  Prologue Length:             29
  Minimum Instruction Length:  1
  Initial value of 'is_stmt':  1
  Line Base:                   -5
  Line Range:                  14
  Opcode Base:                 13

 Opcodes:
  Opcode 1 has 0 args
  Opcode 2 has 1 arg
  Opcode 3 has 1 arg
  Opcode 4 has 1 arg
  Opcode 5 has 1 arg
  Opcode 6 has 0 args
  Opcode 7 has 0 args
  Opcode 8 has 0 args
  Opcode 9 has 1 arg
  Opcode 10 has 0 args
  Opcode 11 has 0 args
  Opcode 12 has 1 arg

 The Directory Table is empty.

 The File Name Table (offset 0x1c):
  Entry Dir     Time    Size    Name
  1     0       0       0       test.c

 Line Number Statements:
  [0x00000027]  Extended opcode 2: set Address to 0x0
  [0x00000032]  Special opcode 8: advance Address by 0 to 0x0 and Line by 3 to
4
  [0x00000033]  Special opcode 62: advance Address by 4 to 0x4 and Line by 1 to
5
  [0x00000034]  Special opcode 118: advance Address by 8 to 0xc and Line by 1
to 6
  [0x00000035]  Special opcode 62: advance Address by 4 to 0x10 and Line by 1
to 7
  [0x00000036]  Advance PC by 8 to 0x18
  [0x00000038]  Extended opcode 1: End of Sequence


Contents of the .debug_str section (loaded from test.o):

  0x00000000 5f5f5549 4e545f46 41535438 5f4d4158 __UINT_FAST8_MAX
  0x00000010 5f5f2030 78666666 66666666 6655005f __ 0xffffffffU._
  0x00000020 5f464c54 36345f48 41535f44 454e4f52 _FLT64_HAS_DENOR
  0x00000030 4d5f5f20 31005f5f 494e545f 46415354 M__ 1.__INT_FAST
...
 0x00002040 2031005f 5f464c54 36345f4d 41585f31  1.__FLT64_MAX_1
  0x00002050 305f4558 505f5f20 33303800 5f5f464c 0_EXP__ 308.__FL
  0x00002060 545f4d41 4e545f44 49475f5f 20323400 T_MANT_DIG__ 24.

Contents of the .debug_frame section (loaded from test.o):


00000000 000000000000000c ffffffff CIE
  Version:               1
  Augmentation:          ""
  Code alignment factor: 1
  Data alignment factor: -4
  Return address column: 67

  DW_CFA_def_cfa: r12 ofs 0

00000010 000000000000001c 00000000 FDE cie=00000000
pc=0000000000000000..0000000000000018
  DW_CFA_advance_loc: 4 to 0000000000000004
  DW_CFA_def_cfa_offset: 32
  DW_CFA_advance_loc: 16 to 0000000000000014
  DW_CFA_def_cfa_offset: 0
  DW_CFA_nop
  DW_CFA_nop
8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----

But the code emitted by clang (-g3 -fdebug-macro -gdwarf-4) does not (only
clang is used from LLVM, GNU binutils are used for assembling/linking):

8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----
kvx-gdb ./test.clang
GNU gdb (GDB) 10.1
Kalray gdb version 4.4.0-6.unstable.0497f39.coolidge.dirty 0497f395-dirty
Copyright (C) 2020 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 "--host=x86_64-pc-linux-gnu --target=kvx-elf".
Type "show configuration" for configuration details.
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 ./test.clang...
(gdb) b main
Breakpoint 1 at 0x19f90: file ../test.c, line 5.
(gdb) r
Starting program: /work1/mpoulhies/scratch/T15367_dwarf_clang/dw4/test.clang

Thread 2 "PE 0 of Cluster0 (mppa 0; board 0)" hit Breakpoint 1, main () at
../test.c:5
5         int a=SUM(1,2);
(gdb) info macro SUM
The symbol `SUM' has no definition as a C/C++ preprocessor macro
at /work1/mpoulhies/scratch/T15367_dwarf_clang/dw4/../test.c:-1
8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----

8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----
test.o:     file format elf64-kvx

Contents of the .debug_str section (loaded from test.o):

  0x00000000 4b616c72 61792063 6c616e67 20766572 Kalray clang ver
  0x00000010 73696f6e 2031302e 302e3120 28676974 sion 10.0.1 (git
  0x00000020 3a736f66 74776172 652f746f 6f6c732f :software/tools/
  0x00000030 6c6c766d 2d70726f 6a656374 20303335 llvm-project 035
  0x00000040 33306631 38386334 61663930 38336330 30f188c4af9083c0
  0x00000050 39366633 66326630 31646365 38353734 96f3f2f01dce8574
  0x00000060 36663939 66290074 6573742e 63002f77 6f99f).test.c./w
  0x00000070 6f726b31 2f6d706f 756c6869 65732f73 ork1/mpoulhies/s
  0x00000080 63726174 63682f54 31353336 375f6477 cratch/T15367_dw
  0x00000090 6172665f 636c616e 672f6477 342f7265 arf_clang/dw4/re
  0x000000a0 74657374 2f636c61 6e67006d 61696e00 test/clang.main.
  0x000000b0 696e7400 6100                       int.a.

Contents of the .debug_abbrev section (loaded from test.o):

  Number TAG (0x0)
   1      DW_TAG_compile_unit    [has children]
    DW_AT_producer     DW_FORM_strp
    DW_AT_language     DW_FORM_data2
    DW_AT_name         DW_FORM_strp
    DW_AT_stmt_list    DW_FORM_data4
    DW_AT_comp_dir     DW_FORM_strp
    DW_AT_low_pc       DW_FORM_addr
    DW_AT_high_pc      DW_FORM_addr
    DW_AT_macro_info   DW_FORM_data4
    DW_AT value: 0     DW_FORM value: 0
   2      DW_TAG_subprogram    [has children]
    DW_AT_low_pc       DW_FORM_addr
    DW_AT_high_pc      DW_FORM_addr
    DW_AT_frame_base   DW_FORM_block1
    DW_AT_name         DW_FORM_strp
    DW_AT_decl_file    DW_FORM_data1
    DW_AT_decl_line    DW_FORM_data1
    DW_AT_type         DW_FORM_ref4
    DW_AT_external     DW_FORM_flag
    DW_AT value: 0     DW_FORM value: 0
   3      DW_TAG_variable    [no children]
    DW_AT_location     DW_FORM_block1
    DW_AT_name         DW_FORM_strp
    DW_AT_decl_file    DW_FORM_data1
    DW_AT_decl_line    DW_FORM_data1
    DW_AT_type         DW_FORM_ref4
    DW_AT value: 0     DW_FORM value: 0
   4      DW_TAG_base_type    [no children]
    DW_AT_name         DW_FORM_strp
    DW_AT_encoding     DW_FORM_data1
    DW_AT_byte_size    DW_FORM_data1
    DW_AT value: 0     DW_FORM value: 0

Contents of the .debug_info section (loaded from test.o):

  Compilation Unit @ offset 0x0:
   Length:        0x63 (32-bit)
   Version:       2
   Abbrev Offset: 0x0
   Pointer Size:  8
 <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <c>   DW_AT_producer    : (indirect string, offset: 0x0): Kalray clang
version 10.0.1 (git:software/tools/llvm-project
03530f188c4af9083c096f3f2f01dce85746f99f)
    <10>   DW_AT_language    : 12       (ANSI C99)
    <12>   DW_AT_name        : (indirect string, offset: 0x67): test.c
    <16>   DW_AT_stmt_list   : 0x0
   <1a>   DW_AT_comp_dir    : (indirect string, offset: 0x6e):
/work1/mpoulhies/scratch/T15367_dwarf_clang/dw4/retest/clang
    <1e>   DW_AT_low_pc      : 0x0
    <26>   DW_AT_high_pc     : 0x20
    <2e>   DW_AT_macro_info  : 0x0
 <1><32>: Abbrev Number: 2 (DW_TAG_subprogram)
    <33>   DW_AT_low_pc      : 0x0
    <3b>   DW_AT_high_pc     : 0x20
    <43>   DW_AT_frame_base  : 1 byte block: 9c         (DW_OP_call_frame_cfa)
    <45>   DW_AT_name        : (indirect string, offset: 0xab): main
    <49>   DW_AT_decl_file   : 1
    <4a>   DW_AT_decl_line   : 3
    <4b>   DW_AT_type        : <0x5f>
    <4f>   DW_AT_external    : 1
 <2><50>: Abbrev Number: 3 (DW_TAG_variable)
    <51>   DW_AT_location    : 2 byte block: 91 64      (DW_OP_fbreg: -28)
    <54>   DW_AT_name        : (indirect string, offset: 0xb4): a
    <58>   DW_AT_decl_file   : 1
    <59>   DW_AT_decl_line   : 5
    <5a>   DW_AT_type        : <0x5f>
 <2><5e>: Abbrev Number: 0
 <1><5f>: Abbrev Number: 4 (DW_TAG_base_type)
    <60>   DW_AT_name        : (indirect string, offset: 0xb0): int
    <64>   DW_AT_encoding    : 5        (signed)
    <65>   DW_AT_byte_size   : 4
 <1><66>: Abbrev Number: 0

Contents of the .debug_macinfo section (loaded from test.o):

 DW_MACINFO_start_file - lineno: 0 filenum: 1
 DW_MACINFO_define - lineno : 1 macro : SUM(a,b) a+b
 DW_MACINFO_end_file
 DW_MACINFO_define - lineno : 0 macro : __llvm__ 1
 DW_MACINFO_define - lineno : 0 macro : __clang__ 1
 DW_MACINFO_define - lineno : 0 macro : __clang_major__ 10
 DW_MACINFO_define - lineno : 0 macro : __clang_minor__ 0
 DW_MACINFO_define - lineno : 0 macro : __clang_patchlevel__ 1
...
 DW_MACINFO_define - lineno : 0 macro : __STDC_UTF_32__ 1
Raw dump of debug contents of section .debug_line (loaded from test.o):

  Offset:                      0x0
  Length:                      124
  DWARF Version:               3
  Prologue Length:             90
  Minimum Instruction Length:  1
  Initial value of 'is_stmt':  1
  Line Base:                   -5
  Line Range:                  14
  Opcode Base:                 13

 Opcodes:
  Opcode 1 has 0 args
  Opcode 2 has 1 arg
  Opcode 3 has 1 arg
  Opcode 4 has 1 arg
  Opcode 5 has 1 arg
  Opcode 6 has 0 args
  Opcode 7 has 0 args
  Opcode 8 has 0 args
  Opcode 9 has 1 arg
  Opcode 10 has 0 args
  Opcode 11 has 0 args
  Opcode 12 has 1 arg

 The Directory Table (offset 0x1b):
  1     /work1/mpoulhies/scratch/T15367_dwarf_clang/dw4/retest/clang

 The File Name Table (offset 0x59):
  Entry Dir     Time    Size    Name
  1     1       0       0       test.c

 Line Number Statements:
  [0x00000064]  Extended opcode 2: set Address to 0x0
  [0x0000006f]  Special opcode 8: advance Address by 0 to 0x0 and Line by 3 to
4
  [0x00000070]  Set column to 7
  [0x00000072]  Set prologue_end to true
  [0x00000073]  Special opcode 230: advance Address by 16 to 0x10 and Line by 1
to 5
  [0x00000074]  Set column to 10
  [0x00000076]  Special opcode 62: advance Address by 4 to 0x14 and Line by 1
to 6
  [0x00000077]  Set column to 3
  [0x00000079]  Set is_stmt to 0
  [0x0000007a]  Special opcode 61: advance Address by 4 to 0x18 and Line by 0
to 6
  [0x0000007b]  Advance PC by 8 to 0x20
  [0x0000007d]  Extended opcode 1: End of Sequence


Contents of the .debug_frame section (loaded from test.o):


00000000 000000000000000c ffffffff CIE
  Version:               1
  Augmentation:          ""
  Code alignment factor: 1
  Data alignment factor: -4
  Return address column: 67

  DW_CFA_def_cfa: r12 ofs 0

00000010 000000000000001c 00000000 FDE cie=00000000
pc=0000000000000000..0000000000000020
  DW_CFA_advance_loc: 4 to 0000000000000004
  DW_CFA_def_cfa_offset: 32
  DW_CFA_advance_loc: 24 to 000000000000001c
  DW_CFA_def_cfa_offset: 0
  DW_CFA_nop
  DW_CFA_nop
8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----


Executing the testsuite with and without the patch shows no difference.

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

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

* [Bug gdb/27306] macro definition not found except when using -a
  2021-02-01 10:40 [Bug gdb/27306] New: macro definition not found except when using -a mpoulhies at kalray dot eu
@ 2021-02-01 10:41 ` mpoulhies at kalray dot eu
  2021-02-01 10:42 ` mpoulhies at kalray dot eu
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mpoulhies at kalray dot eu @ 2021-02-01 10:41 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Marc <mpoulhies at kalray dot eu> ---
Created attachment 13187
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13187&action=edit
objdump -g test.o (clang version)

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

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

* [Bug gdb/27306] macro definition not found except when using -a
  2021-02-01 10:40 [Bug gdb/27306] New: macro definition not found except when using -a mpoulhies at kalray dot eu
  2021-02-01 10:41 ` [Bug gdb/27306] " mpoulhies at kalray dot eu
@ 2021-02-01 10:42 ` mpoulhies at kalray dot eu
  2021-02-01 19:13 ` simark at simark dot ca
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mpoulhies at kalray dot eu @ 2021-02-01 10:42 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Marc <mpoulhies at kalray dot eu> ---
Created attachment 13188
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13188&action=edit
patch that works around the issue

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

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

* [Bug gdb/27306] macro definition not found except when using -a
  2021-02-01 10:40 [Bug gdb/27306] New: macro definition not found except when using -a mpoulhies at kalray dot eu
  2021-02-01 10:41 ` [Bug gdb/27306] " mpoulhies at kalray dot eu
  2021-02-01 10:42 ` mpoulhies at kalray dot eu
@ 2021-02-01 19:13 ` simark at simark dot ca
  2021-02-02  8:07 ` mpoulhies at kalray dot eu
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: simark at simark dot ca @ 2021-02-01 19:13 UTC (permalink / raw)
  To: gdb-prs

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

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simark at simark dot ca

--- Comment #3 from Simon Marchi <simark at simark dot ca> ---
Hi Marc,

Note that we don't use bugzilla for code review, so if you'd like to propose
your patch for merging, please follow the steps here:

https://sourceware.org/gdb/wiki/ContributionChecklist

Simon

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

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

* [Bug gdb/27306] macro definition not found except when using -a
  2021-02-01 10:40 [Bug gdb/27306] New: macro definition not found except when using -a mpoulhies at kalray dot eu
                   ` (2 preceding siblings ...)
  2021-02-01 19:13 ` simark at simark dot ca
@ 2021-02-02  8:07 ` mpoulhies at kalray dot eu
  2021-05-12 11:49 ` tom at compton dot nu
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mpoulhies at kalray dot eu @ 2021-02-02  8:07 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Marc <mpoulhies at kalray dot eu> ---
I am not 100% sure I'm not hacking my way around another problem. So I was
hoping that I would get some feedback here before asking for merging this
possible fix. I've asked on IRC first and was hinted that my use case should
already work, so possibly a gdb bug, hence the bug report.

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

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

* [Bug gdb/27306] macro definition not found except when using -a
  2021-02-01 10:40 [Bug gdb/27306] New: macro definition not found except when using -a mpoulhies at kalray dot eu
                   ` (3 preceding siblings ...)
  2021-02-02  8:07 ` mpoulhies at kalray dot eu
@ 2021-05-12 11:49 ` tom at compton dot nu
  2021-05-12 15:58 ` keiths at redhat dot com
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: tom at compton dot nu @ 2021-05-12 11:49 UTC (permalink / raw)
  To: gdb-prs

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

Tom Hughes <tom at compton dot nu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tom at compton dot nu

--- Comment #5 from Tom Hughes <tom at compton dot nu> ---
I'm also seeing this problem since switching from DWARF4 to DWARF5 that macro
expansion no longer works.

I can confirm that the patch here fixes things for me.

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

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

* [Bug gdb/27306] macro definition not found except when using -a
  2021-02-01 10:40 [Bug gdb/27306] New: macro definition not found except when using -a mpoulhies at kalray dot eu
                   ` (4 preceding siblings ...)
  2021-05-12 11:49 ` tom at compton dot nu
@ 2021-05-12 15:58 ` keiths at redhat dot com
  2021-05-12 16:18 ` keiths at redhat dot com
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: keiths at redhat dot com @ 2021-05-12 15:58 UTC (permalink / raw)
  To: gdb-prs

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

Keith Seitz <keiths at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |keiths at redhat dot com
   Last reconfirmed|                            |2021-05-12
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #6 from Keith Seitz <keiths at redhat dot com> ---
Confirmed on master and gdb-10-branch for all -gdwarf-N that I tried (GCC
11.1.1 20210428). The reporter's patch also appears to fix it.

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

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

* [Bug gdb/27306] macro definition not found except when using -a
  2021-02-01 10:40 [Bug gdb/27306] New: macro definition not found except when using -a mpoulhies at kalray dot eu
                   ` (5 preceding siblings ...)
  2021-05-12 15:58 ` keiths at redhat dot com
@ 2021-05-12 16:18 ` keiths at redhat dot com
  2021-05-12 17:15 ` mpoulhies at kalray dot eu
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: keiths at redhat dot com @ 2021-05-12 16:18 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #7 from Keith Seitz <keiths at redhat dot com> ---
(In reply to Keith Seitz from comment #6)
> Confirmed on master and gdb-10-branch for all -gdwarf-N that I tried (GCC
> 11.1.1 20210428). The reporter's patch also appears to fix it.

My bad. Actually, the reporter is correct: ONLY -gdwarf-5 triggers the
bug.

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

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

* [Bug gdb/27306] macro definition not found except when using -a
  2021-02-01 10:40 [Bug gdb/27306] New: macro definition not found except when using -a mpoulhies at kalray dot eu
                   ` (6 preceding siblings ...)
  2021-05-12 16:18 ` keiths at redhat dot com
@ 2021-05-12 17:15 ` mpoulhies at kalray dot eu
  2021-05-12 19:55 ` keiths at redhat dot com
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mpoulhies at kalray dot eu @ 2021-05-12 17:15 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #8 from Marc <mpoulhies at kalray dot eu> ---
Sorry for not sending my potential fix to the mailing list. I was thinking it
could be helpful for anyone willing to fix this as I'm not very confident in my
fix. But that may be better to send it for review!

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

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

* [Bug gdb/27306] macro definition not found except when using -a
  2021-02-01 10:40 [Bug gdb/27306] New: macro definition not found except when using -a mpoulhies at kalray dot eu
                   ` (7 preceding siblings ...)
  2021-05-12 17:15 ` mpoulhies at kalray dot eu
@ 2021-05-12 19:55 ` keiths at redhat dot com
  2021-05-13  6:54 ` mpoulhies at kalray dot eu
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: keiths at redhat dot com @ 2021-05-12 19:55 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #9 from Keith Seitz <keiths at redhat dot com> ---
(In reply to Marc from comment #8)
> Sorry for not sending my potential fix to the mailing list. I was thinking
> it could be helpful for anyone willing to fix this as I'm not very confident
> in my fix. But that may be better to send it for review!

Actually, I've been looking at this today. This is apparently a bug that has
been around for quite some time. I'm still tracking it down to the origin, but
I should have a proper fix in the next day or so, if my schedule doesn't throw
an exception.

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

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

* [Bug gdb/27306] macro definition not found except when using -a
  2021-02-01 10:40 [Bug gdb/27306] New: macro definition not found except when using -a mpoulhies at kalray dot eu
                   ` (8 preceding siblings ...)
  2021-05-12 19:55 ` keiths at redhat dot com
@ 2021-05-13  6:54 ` mpoulhies at kalray dot eu
  2023-05-03  8:32 ` tom at compton dot nu
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mpoulhies at kalray dot eu @ 2021-05-13  6:54 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #10 from Marc <mpoulhies at kalray dot eu> ---
Ok, thanks for the update !

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

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

* [Bug gdb/27306] macro definition not found except when using -a
  2021-02-01 10:40 [Bug gdb/27306] New: macro definition not found except when using -a mpoulhies at kalray dot eu
                   ` (9 preceding siblings ...)
  2021-05-13  6:54 ` mpoulhies at kalray dot eu
@ 2023-05-03  8:32 ` tom at compton dot nu
  2023-05-03  8:39 ` tom at compton dot nu
  2023-05-03 13:36 ` simon.marchi at polymtl dot ca
  12 siblings, 0 replies; 14+ messages in thread
From: tom at compton dot nu @ 2023-05-03  8:32 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #11 from Tom Hughes <tom at compton dot nu> ---
It seems that gdb 13 has fixed this, and I no longer need to apply the patch
from this bug for macros to work with DWARF5.

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

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

* [Bug gdb/27306] macro definition not found except when using -a
  2021-02-01 10:40 [Bug gdb/27306] New: macro definition not found except when using -a mpoulhies at kalray dot eu
                   ` (10 preceding siblings ...)
  2023-05-03  8:32 ` tom at compton dot nu
@ 2023-05-03  8:39 ` tom at compton dot nu
  2023-05-03 13:36 ` simon.marchi at polymtl dot ca
  12 siblings, 0 replies; 14+ messages in thread
From: tom at compton dot nu @ 2023-05-03  8:39 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #12 from Tom Hughes <tom at compton dot nu> ---
I'm guessing
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=f71ad5556cf5ad3bb938d6ba1b5eca1e79d8d740
was the fix.

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

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

* [Bug gdb/27306] macro definition not found except when using -a
  2021-02-01 10:40 [Bug gdb/27306] New: macro definition not found except when using -a mpoulhies at kalray dot eu
                   ` (11 preceding siblings ...)
  2023-05-03  8:39 ` tom at compton dot nu
@ 2023-05-03 13:36 ` simon.marchi at polymtl dot ca
  12 siblings, 0 replies; 14+ messages in thread
From: simon.marchi at polymtl dot ca @ 2023-05-03 13:36 UTC (permalink / raw)
  To: gdb-prs

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

Simon Marchi <simon.marchi at polymtl dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simon.marchi at polymtl dot ca
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #13 from Simon Marchi <simon.marchi at polymtl dot ca> ---
Most likely, yes.  Marking as fixed.

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

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

end of thread, other threads:[~2023-05-03 13:36 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 10:40 [Bug gdb/27306] New: macro definition not found except when using -a mpoulhies at kalray dot eu
2021-02-01 10:41 ` [Bug gdb/27306] " mpoulhies at kalray dot eu
2021-02-01 10:42 ` mpoulhies at kalray dot eu
2021-02-01 19:13 ` simark at simark dot ca
2021-02-02  8:07 ` mpoulhies at kalray dot eu
2021-05-12 11:49 ` tom at compton dot nu
2021-05-12 15:58 ` keiths at redhat dot com
2021-05-12 16:18 ` keiths at redhat dot com
2021-05-12 17:15 ` mpoulhies at kalray dot eu
2021-05-12 19:55 ` keiths at redhat dot com
2021-05-13  6:54 ` mpoulhies at kalray dot eu
2023-05-03  8:32 ` tom at compton dot nu
2023-05-03  8:39 ` tom at compton dot nu
2023-05-03 13:36 ` simon.marchi at polymtl dot ca

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).