Fix for Atmel - "no debugging available"

Go To Last Post
27 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This AS5 thing just about wound me off the end stop with it's spurious ""No debugging information available" for a project built with -g so when it just happened I checked the generated .elf file with:

C:\AS5\AVRGCC1\AVRGCC1\Debug>avr-readelf --debug-dump AVRGCC1.elf
Contents of the .debug_aranges section:

  Length:                   28
  Version:                  2
  Offset into .debug_info:  0x0
  Pointer Size:             4
  Segment Size:             0

    Address    Length
    0000006c 00000010
    00000000 00000000

Contents of the .debug_pubnames section:

  Length:                              23
  Version:                             2
  Offset into .debug_info section:     0x0
  Size of area in .debug_info section: 144

    Offset      Name
    68          main

Contents of the .debug_info section:

  Compilation Unit @ offset 0x0:
   Length:        0x8c (32-bit)
   Version:       2
   Abbrev Offset: 0
   Pointer Size:  4
 <0>: Abbrev Number: 1 (DW_TAG_compile_unit)
    < c>   DW_AT_producer    : (indirect string, offset: 0xe): GNU C 4.5.1
    <10>   DW_AT_language    : 1        (ANSI C)
    <11>   DW_AT_name        : (indirect string, offset: 0x31): .././AVRGCC1.c
    <15>   DW_AT_comp_dir    : (indirect string, offset: 0x5b): C:\\AS5\\AVRGCC1\\AVRGCC1\\Debug
    <19>   DW_AT_low_pc      : 0x6c
    <1d>   DW_AT_high_pc     : 0x7c
    <21>   DW_AT_stmt_list   : 0x0
 <1><25>: Abbrev Number: 2 (DW_TAG_base_type)
    <26>   DW_AT_byte_size   : 1
    <27>   DW_AT_encoding    : 6        (signed char)
    <28>   DW_AT_name        : (indirect string, offset: 0x4a): signed char
 <1><2c>: Abbrev Number: 3 (DW_TAG_typedef)
    <2d>   DW_AT_name        : (indirect string, offset: 0x40): uint8_t
    <31>   DW_AT_decl_file   : 2
    <32>   DW_AT_decl_line   : 122
    <33>   DW_AT_type        : <0x37>
 <1><37>: Abbrev Number: 2 (DW_TAG_base_type)
    <38>   DW_AT_byte_size   : 1
    <39>   DW_AT_encoding    : 8        (unsigned char)
    <3a>   DW_AT_name        : (indirect string, offset: 0x48): unsigned char
 <1><3e>: Abbrev Number: 4 (DW_TAG_base_type)
    <3f>   DW_AT_byte_size   : 2
    <40>   DW_AT_encoding    : 5        (signed)
    <41>   DW_AT_name        : int
 <1><45>: Abbrev Number: 2 (DW_TAG_base_type)
    <46>   DW_AT_byte_size   : 2
    <47>   DW_AT_encoding    : 7        (unsigned)
    <48>   DW_AT_name        : (indirect string, offset: 0x24): unsigned int
 <1><4c>: Abbrev Number: 2 (DW_TAG_base_type)
    <4d>   DW_AT_byte_size   : 4
    <4e>   DW_AT_encoding    : 5        (signed)
    <4f>   DW_AT_name        : (indirect string, offset: 0x5): long int
 <1><53>: Abbrev Number: 2 (DW_TAG_base_type)
    <54>   DW_AT_byte_size   : 4
    <55>   DW_AT_encoding    : 7        (unsigned)
    <56>   DW_AT_name        : (indirect string, offset: 0x1f): long unsigned int
 <1><5a>: Abbrev Number: 2 (DW_TAG_base_type)
    <5b>   DW_AT_byte_size   : 8
    <5c>   DW_AT_encoding    : 5        (signed)
    <5d>   DW_AT_name        : (indirect string, offset: 0x0): long long int
 <1><61>: Abbrev Number: 2 (DW_TAG_base_type)
    <62>   DW_AT_byte_size   : 8
    <63>   DW_AT_encoding    : 7        (unsigned)
    <64>   DW_AT_name        : (indirect string, offset: 0x1a): long long unsigned int
 <1><68>: Abbrev Number: 5 (DW_TAG_subprogram)
    <69>   DW_AT_external    : 1
    <6a>   DW_AT_name        : (indirect string, offset: 0x56): main
    <6e>   DW_AT_decl_file   : 1
    <6f>   DW_AT_decl_line   : 3
    <70>   DW_AT_prototyped  : 1
    <71>   DW_AT_type        : <0x3e>
    <75>   DW_AT_low_pc      : 0x6c
    <79>   DW_AT_high_pc     : 0x7c
    <7d>   DW_AT_frame_base  : 3 byte block: 92 20 0    (DW_OP_bregx: 32 0)
 <2><81>: Abbrev Number: 6 (DW_TAG_variable)
    <82>   DW_AT_name        : i
    <84>   DW_AT_decl_file   : 1
    <85>   DW_AT_decl_line   : 4
    <86>   DW_AT_type        : <0x2c>
    <8a>   DW_AT_location    : 0x0      (location list)

Contents of the .debug_abbrev section:

  Number TAG
   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_addr
    DW_AT_stmt_list    DW_FORM_data4
   2      DW_TAG_base_type    [no children]
    DW_AT_byte_size    DW_FORM_data1
    DW_AT_encoding     DW_FORM_data1
    DW_AT_name         DW_FORM_strp
   3      DW_TAG_typedef    [no children]
    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
   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
   5      DW_TAG_subprogram    [has children]
    DW_AT_external     DW_FORM_flag
    DW_AT_name         DW_FORM_strp
    DW_AT_decl_file    DW_FORM_data1
    DW_AT_decl_line    DW_FORM_data1
    DW_AT_prototyped   DW_FORM_flag
    DW_AT_type         DW_FORM_ref4
    DW_AT_low_pc       DW_FORM_addr
    DW_AT_high_pc      DW_FORM_addr
    DW_AT_frame_base   DW_FORM_block1
   6      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_data4

Raw dump of debug contents of section .debug_line:

  Offset:                      0x0
  Length:                      203
  DWARF Version:               2
  Prologue Length:             147
  Minimum Instruction Length:  1
  Initial value of 'is_stmt':  1
  Line Base:                   -10
  Line Range:                  245
  Opcode Base:                 10

 Opcodes:
  Opcode 1 has 0 args
  Opcode 2 has 1 args
  Opcode 3 has 1 args
  Opcode 4 has 1 args
  Opcode 5 has 1 args
  Opcode 6 has 0 args
  Opcode 7 has 0 args
  Opcode 8 has 0 args
  Opcode 9 has 1 args

 The Directory Table:
  ../.
  c:\program files\atmel\avr studio 5.0\avr toolchain\bin\../lib/gcc/avr/4.5.1/../../../../avr/include

 The File Name Table:
  Entry Dir     Time    Size    Name
  1     1       0       0       AVRGCC1.c
  2     2       0       0       stdint.h

 Line Number Statements:
  Extended opcode 2: set Address to 0x6c
  Special opcode 12: advance Address by 0 to 0x6c and Line by 2 to 3
  Extended opcode 2: set Address to 0x6c
  Special opcode 12: advance Address by 0 to 0x6c and Line by 2 to 5
  Extended opcode 2: set Address to 0x70
  Special opcode 12: advance Address by 0 to 0x70 and Line by 2 to 7
  Extended opcode 2: set Address to 0x72
  Special opcode 11: advance Address by 0 to 0x72 and Line by 1 to 8
  Extended opcode 2: set Address to 0x74
  Special opcode 9: advance Address by 0 to 0x74 and Line by -1 to 7
  Extended opcode 2: set Address to 0x7c
  Extended opcode 1: End of Sequence


  Offset:                      0xcf
  Length:                      22
  DWARF Version:               2
  Prologue Length:             16
  Minimum Instruction Length:  1
  Initial value of 'is_stmt':  1
  Line Base:                   -5
  Line Range:                  14
  Opcode Base:                 10

 Opcodes:
  Opcode 1 has 0 args
  Opcode 2 has 1 args
  Opcode 3 has 1 args
  Opcode 4 has 1 args
  Opcode 5 has 1 args
  Opcode 6 has 0 args
  Opcode 7 has 0 args
  Opcode 8 has 0 args
  Opcode 9 has 1 args

 The Directory Table is empty.

 The File Name Table is empty.

 Line Number Statements:

Contents of the .debug_frame section:

00000000 0000000c ffffffff CIE
  Version:               1
  Augmentation:          ""
  Code alignment factor: 1
  Data alignment factor: -1
  Return address column: 36

  DW_CFA_def_cfa: r32 ofs 0

00000010 0000000c 00000000 FDE cie=00000000 pc=0000006c..0000007c

Contents of the .debug_str section:

  0x00000000 6c6f6e67 206c6f6e 6720696e 7400474e long long int.GN
  0x00000010 55204320 342e352e 31006c6f 6e67206c U C 4.5.1.long l
  0x00000020 6f6e6720 756e7369 676e6564 20696e74 ong unsigned int
  0x00000030 002e2e2f 2e2f4156 52474343 312e6300 ..././AVRGCC1.c.
  0x00000040 75696e74 385f7400 756e7369 676e6564 uint8_t.unsigned
  0x00000050 20636861 72006d61 696e0043 3a5c5c41  char.main.C:\\A
  0x00000060 53355c5c 41565247 4343315c 5c415652 S5\\AVRGCC1\\AVR
  0x00000070 47434331 5c5c4465 62756700          GCC1\\Debug.

Contents of the .debug_loc section:

    Offset   Begin    End      Expression
    00000000 00000070 00000072 (DW_OP_lit0; DW_OP_stack_value)
    00000000 00000076 0000007c (DW_OP_reg24)
    00000000 

Contents of the .debug_pubtypes section:

  Length:                              26
  Version:                             2
  Offset into .debug_info section:     0x0
  Size of area in .debug_info section: 144

    Offset      Name
    2c          uint8_t

I then simply created a new project and copied the few lines of source into the newly created .c file:

#include 

int main(void) {
 uint8_t i;
 DDRB = 0xFF;
 while(1) {
   for (i = 0; i < 10; i++) {
     PORTB = i;
   }
 }
}

Then after building I performed the same exercise with avr-readelf:

C:\AS5\AVRGCC2\AVRGCC2\Debug>avr-readelf --debug-dump AVRGCC2.elf
Contents of the .debug_aranges section:

  Length:                   28
  Version:                  2
  Offset into .debug_info:  0x0
  Pointer Size:             4
  Segment Size:             0

    Address    Length
    0000006c 00000030
    00000000 00000000

Contents of the .debug_pubnames section:

  Length:                              23
  Version:                             2
  Offset into .debug_info section:     0x0
  Size of area in .debug_info section: 143

    Offset      Name
    68          main

Contents of the .debug_info section:

  Compilation Unit @ offset 0x0:
   Length:        0x8b (32-bit)
   Version:       2
   Abbrev Offset: 0
   Pointer Size:  4
 <0>: Abbrev Number: 1 (DW_TAG_compile_unit)
    < c>   DW_AT_producer    : (indirect string, offset: 0xe): GNU C 4.5.1
    <10>   DW_AT_language    : 1        (ANSI C)
    <11>   DW_AT_name        : (indirect string, offset: 0x69): .././AVRGCC2.c
    <15>   DW_AT_comp_dir    : (indirect string, offset: 0x31): C:\AS5\AVRGCC2\AVRGCC2\Debug
    <19>   DW_AT_low_pc      : 0x6c
    <1d>   DW_AT_high_pc     : 0x9c
    <21>   DW_AT_stmt_list   : 0x0
 <1><25>: Abbrev Number: 2 (DW_TAG_base_type)
    <26>   DW_AT_byte_size   : 1
    <27>   DW_AT_encoding    : 6        (signed char)
    <28>   DW_AT_name        : (indirect string, offset: 0x58): signed char
 <1><2c>: Abbrev Number: 3 (DW_TAG_typedef)
    <2d>   DW_AT_name        : (indirect string, offset: 0x4e): uint8_t
    <31>   DW_AT_decl_file   : 2
    <32>   DW_AT_decl_line   : 122
    <33>   DW_AT_type        : <0x37>
 <1><37>: Abbrev Number: 2 (DW_TAG_base_type)
    <38>   DW_AT_byte_size   : 1
    <39>   DW_AT_encoding    : 8        (unsigned char)
    <3a>   DW_AT_name        : (indirect string, offset: 0x56): unsigned char
 <1><3e>: Abbrev Number: 4 (DW_TAG_base_type)
    <3f>   DW_AT_byte_size   : 2
    <40>   DW_AT_encoding    : 5        (signed)
    <41>   DW_AT_name        : int
 <1><45>: Abbrev Number: 2 (DW_TAG_base_type)
    <46>   DW_AT_byte_size   : 2
    <47>   DW_AT_encoding    : 7        (unsigned)
    <48>   DW_AT_name        : (indirect string, offset: 0x24): unsigned int
 <1><4c>: Abbrev Number: 2 (DW_TAG_base_type)
    <4d>   DW_AT_byte_size   : 4
    <4e>   DW_AT_encoding    : 5        (signed)
    <4f>   DW_AT_name        : (indirect string, offset: 0x5): long int
 <1><53>: Abbrev Number: 2 (DW_TAG_base_type)
    <54>   DW_AT_byte_size   : 4
    <55>   DW_AT_encoding    : 7        (unsigned)
    <56>   DW_AT_name        : (indirect string, offset: 0x1f): long unsigned int
 <1><5a>: Abbrev Number: 2 (DW_TAG_base_type)
    <5b>   DW_AT_byte_size   : 8
    <5c>   DW_AT_encoding    : 5        (signed)
    <5d>   DW_AT_name        : (indirect string, offset: 0x0): long long int
 <1><61>: Abbrev Number: 2 (DW_TAG_base_type)
    <62>   DW_AT_byte_size   : 8
    <63>   DW_AT_encoding    : 7        (unsigned)
    <64>   DW_AT_name        : (indirect string, offset: 0x1a): long long unsigned int
 <1><68>: Abbrev Number: 5 (DW_TAG_subprogram)
    <69>   DW_AT_external    : 1
    <6a>   DW_AT_name        : (indirect string, offset: 0x64): main
    <6e>   DW_AT_decl_file   : 1
    <6f>   DW_AT_decl_line   : 3
    <70>   DW_AT_prototyped  : 1
    <71>   DW_AT_type        : <0x3e>
    <75>   DW_AT_low_pc      : 0x6c
    <79>   DW_AT_high_pc     : 0x9c
    <7d>   DW_AT_frame_base  : 3 byte block: 92 20 0    (DW_OP_bregx: 32 0)
 <2><81>: Abbrev Number: 6 (DW_TAG_variable)
    <82>   DW_AT_name        : i
    <84>   DW_AT_decl_file   : 1
    <85>   DW_AT_decl_line   : 4
    <86>   DW_AT_type        : <0x2c>
    <8a>   DW_AT_location    : 2 byte block: 8c 1       (DW_OP_breg28: 1)

Contents of the .debug_abbrev section:

  Number TAG
   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_addr
    DW_AT_stmt_list    DW_FORM_data4
   2      DW_TAG_base_type    [no children]
    DW_AT_byte_size    DW_FORM_data1
    DW_AT_encoding     DW_FORM_data1
    DW_AT_name         DW_FORM_strp
   3      DW_TAG_typedef    [no children]
    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
   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
   5      DW_TAG_subprogram    [has children]
    DW_AT_external     DW_FORM_flag
    DW_AT_name         DW_FORM_strp
    DW_AT_decl_file    DW_FORM_data1
    DW_AT_decl_line    DW_FORM_data1
    DW_AT_prototyped   DW_FORM_flag
    DW_AT_type         DW_FORM_ref4
    DW_AT_low_pc       DW_FORM_addr
    DW_AT_high_pc      DW_FORM_addr
    DW_AT_frame_base   DW_FORM_block1
   6      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_block1

Raw dump of debug contents of section .debug_line:

  Offset:                      0x0
  Length:                      219
  DWARF Version:               2
  Prologue Length:             147
  Minimum Instruction Length:  1
  Initial value of 'is_stmt':  1
  Line Base:                   -10
  Line Range:                  245
  Opcode Base:                 10

 Opcodes:
  Opcode 1 has 0 args
  Opcode 2 has 1 args
  Opcode 3 has 1 args
  Opcode 4 has 1 args
  Opcode 5 has 1 args
  Opcode 6 has 0 args
  Opcode 7 has 0 args
  Opcode 8 has 0 args
  Opcode 9 has 1 args

 The Directory Table:
  ../.
  c:\program files\atmel\avr studio 5.0\avr toolchain\bin\../lib/gcc/avr/4.5.1/../../../../avr/include

 The File Name Table:
  Entry Dir     Time    Size    Name
  1     1       0       0       AVRGCC2.c
  2     2       0       0       stdint.h

 Line Number Statements:
  Extended opcode 2: set Address to 0x6c
  Special opcode 12: advance Address by 0 to 0x6c and Line by 2 to 3
  Extended opcode 2: set Address to 0x76
  Special opcode 12: advance Address by 0 to 0x76 and Line by 2 to 5
  Extended opcode 2: set Address to 0x80
  Special opcode 12: advance Address by 0 to 0x80 and Line by 2 to 7
  Extended opcode 2: set Address to 0x84
  Special opcode 11: advance Address by 0 to 0x84 and Line by 1 to 8
  Extended opcode 2: set Address to 0x8e
  Special opcode 9: advance Address by 0 to 0x8e and Line by -1 to 7
  Extended opcode 2: set Address to 0x94
  Copy
  Extended opcode 2: set Address to 0x9a
  Special opcode 13: advance Address by 0 to 0x9a and Line by 3 to 10
  Extended opcode 2: set Address to 0x9c
  Extended opcode 1: End of Sequence


  Offset:                      0xdf
  Length:                      22
  DWARF Version:               2
  Prologue Length:             16
  Minimum Instruction Length:  1
  Initial value of 'is_stmt':  1
  Line Base:                   -5
  Line Range:                  14
  Opcode Base:                 10

 Opcodes:
  Opcode 1 has 0 args
  Opcode 2 has 1 args
  Opcode 3 has 1 args
  Opcode 4 has 1 args
  Opcode 5 has 1 args
  Opcode 6 has 0 args
  Opcode 7 has 0 args
  Opcode 8 has 0 args
  Opcode 9 has 1 args

 The Directory Table is empty.

 The File Name Table is empty.

 Line Number Statements:

Contents of the .debug_frame section:

00000000 0000000c ffffffff CIE
  Version:               1
  Augmentation:          ""
  Code alignment factor: 1
  Data alignment factor: -1
  Return address column: 36

  DW_CFA_def_cfa: r32 ofs 0

00000010 0000000c 00000000 FDE cie=00000000 pc=0000006c..0000009c

Contents of the .debug_str section:

  0x00000000 6c6f6e67 206c6f6e 6720696e 7400474e long long int.GN
  0x00000010 55204320 342e352e 31006c6f 6e67206c U C 4.5.1.long l
  0x00000020 6f6e6720 756e7369 676e6564 20696e74 ong unsigned int
  0x00000030 00433a5c 4153355c 41565247 4343325c .C:\AS5\AVRGCC2\
  0x00000040 41565247 4343325c 44656275 67007569 AVRGCC2\Debug.ui
  0x00000050 6e74385f 7400756e 7369676e 65642063 nt8_t.unsigned c
  0x00000060 68617200 6d61696e 002e2e2f 2e2f4156 har.main..././AV
  0x00000070 52474343 322e6300                   RGCC2.c.

Contents of the .debug_pubtypes section:

  Length:                              26
  Version:                             2
  Offset into .debug_info section:     0x0
  Size of area in .debug_info section: 143

    Offset      Name
    2c          uint8_t

The one that works has this:

    <15>   DW_AT_comp_dir    : (indirect string, offset: 0x31): C:\AS5\AVRGCC2\AVRGCC2\Debug

resulting from this;

  0x00000030 00433a5c 4153355c 41565247 4343325c .C:\AS5\AVRGCC2\
  0x00000040 41565247 4343325c 44656275 67007569 AVRGCC2\Debug.ui

While the one that fails has

    <15>   DW_AT_comp_dir    : (indirect string, offset: 0x5b): C:\\AS5\\AVRGCC1\\AVRGCC1\\Debug

resulting from:

  0x00000050 20636861 72006d61 696e0043 3a5c5c41  char.main.C:\\A
  0x00000060 53355c5c 41565247 4343315c 5c415652 S5\\AVRGCC1\\AVR
  0x00000070 47434331 5c5c4465 62756700          GCC1\\Debug.

The one that works has single slashes, the one that doesn't has double slashes.

Now I guess you could try and work out why one build generated one kind of path separator and the other generated the other. But if you ELF reader in AS5 were simply willing to read "\\" as "\" that would seem to be a way to work around the problem.

Cliff

(mail my £5 for the consultancy to the usual address! ;-))

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
But if you ELF reader in AS5 were simply willing to read "\\" as "\" that would seem to be a way to work around the problem.

Are you still assuming they are listening, Cliff? :shock:

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Are you still assuming they are listening, Cliff?

Hope so, my £5 depends on it!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Great work Cliff!

I would be very interested in possessing that objectfile with the "\\"s.
Would you go to the trouble to add it as an attachment to a post here?

Any more ideas on why DW_AT_compile_dir folders were suddenly separated by two backslashes?

Torleif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The non-worker (AVRGCC1.elf) and the worker (AVRGCC2.elf) are attached.

I had to give them a .txt extension to allow the upload to work.

While uploading I cannot help noticing that the two supposedly almost identical files (both generated from the same small bit of C source) are radically different in size (5K versus 38K) which is "odd" in itself.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't AS5, but can't the difference lie in how gcc was exactly invoked in the two cases?

JW

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I don't AS5, but can't the difference lie in how gcc was exactly invoked in the two cases?


It *should* have been totally identical (I believe)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Seeing is believing... :-)

And the proof... (namely the command-line invocation)? Or does AS5 totally hide that? In that case, couldn't you throw a fake avr-gcc.exe into the respective directory in order to print out the invocation?

JW

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I fail to reproduce the "no source available" issue you are describing.

I created a new as5 project on the exact same location you use. I then built the project, replaced the elf file with your AVRGCC1.elf file, touched the file to avoid recompilation and started debugging. This works every time. I confirmed that the double backslashes are still present in the DW_AT_comp_dir attribute.

This is on build 1163, (The 5.0 release build)
I am using AVRDragon and atmega 2560.

What target are you debugging against?

I understand that you are seeing that AVRGCC1 consistently fail while AVRGCC2 works all the time?

Torleif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One more thing:
We have seen the "no source available" bug on several occations. In most cases it has had to do with race conditions between received emulator events and the Visual studio debug engine.
Since the AVRStudio5.0 release we think we have fixed most of these bugs. What makes it hard is that different emulators/device families/interfaces behave differently.
Also, reproducing these issues is difficult since it depends on computer speed, JTAG frequency, Device clock frequency...

Torleif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

What target are you debugging against?


Simulator - that's the only place I've seen the "no debugging" thing and when it occurs it's completely consistent.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh wait, to post the build output I just tried cleaning then building each project in turn which is when I noticed that the one that worked was built for ATmega128 rather than the ATmega16 I had intended. So I changed the second one to ATmega16 and did clean/build and now it also shows the no debugging message. So this *could* be as simple as creating/building a project for one target then changing the target and rebuilding. I find that if I now switch that second project back to the original ATmega128 it still leads to the "no debugging" message.

I'll try a new AVRGCC3 built initially for 128 then switched to 16 and see what transpires...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well this is going well (not). I exited from AS5 then restarted it (just to be sure!). Then used The option to create a new project. I selected "GCC executable" and set the device to be ATmega128. Everything else at default. When the new file with the C template appeared I simply deleted all the text and replaced with:

#include 

int main(void) {
 uint8_t i;
 DDRB = 0xFF;
 while(1) {
   for (i = 0; i < 10; i++) {
     PORTB = i;
   }
 }
}

then built that and tried "Start Debugging and Break". It immediately lead to the "No debug" warning. So I officially give up with (a) trying to recreate this and (b) using AS5. It seems to me that you only have to use this, err, "program" for about 3 seconds to hit something seriously wrong so I'm kind of surprised this fault is proving difficult to recreate. My experience is that I think I've only ever managed to use the simulator about 3 or 4 times out of 20+ attempts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, I am sorry about the problems you are seeing and sorry that you will stop using AS5.

Thanks for valuable input anyway.

Torleif

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think this is a very, very poor and disappointing answer by atmel (torleif seems to belong to them).

It´s obvious, that the bug is depending on timing constellations. And the bug exists in different VS2010-environments outside AVR too (see in Google).

All involved developer seem to be incompetent to solve this issue!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is Atmel's normal modus operandi. They are much better at leading customers by the nose than at programming.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I think this is a very, very poor and disappointing answer by atmel (torleif seems to belong to them).

It´s obvious, that the bug is depending on timing constellations. And the bug exists in different VS2010-environments outside AVR too (see in Google).

All involved developer seem to be incompetent to solve this issue!

Hate the product, not the person. Remember that there is an enormous amount of backend code (both Atmel and MS combined) that makes up AS5, and many different systems with different speeds -- just because yours triggers it doesn't necessarily mean that Atmel can reproduce it easily.

I agree that it needs to be fixed and is a real problem, but perhaps it will be sorted in the 5.1 update that is (allegedly) due soon.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Tell that the Atmel people who found it very funny taking me for a ride when I couldn't find the ASF Xmega download. Oh wait, weren't you one of them?

Tell that this Dag Arne Braend from Atmel who first disses customers in this video that they are too stupid to get it right. And then suggests "quality from the start" with Atmel "quality development tools". http://www.youtube.com/watch?v=T...

Or tell it this Haakon Skar from Atmel, who first disses customers that they shit their pants over Windows and then disses JTAG debugging in Eclipse and gets excited that Atmel will force Studio 5 down the developer's throats. And listen to the promises he makes about ASF. http://video.eetimes.com/playlis...

As long as Atmel hates customers and takes them for a ride to cover-up Atmel's incompetence you shouldn't be surprised that people hate Atmel. I really regret I started with Atmel, especially because I was warned.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

torleifs wrote:
One more thing:
We have seen the "no source available" bug on several occations........
Also, reproducing these issues is difficult since it depends on computer speed, JTAG frequency, Device clock frequency...

Torleif

Sorry Torleif, this is simply not true.

It IS very easy to reproduce the "no source available" bug.
I have purchased the new JTAGICE3 and so I have to use Studio 5. It took me only one simple demo project and 5 minutes to reproduce this bug.
Now I have spend a lot of money for the ICE3 tool and cannot use it.
I really hope that a bugfix comes soon and I do not loose my money by purchasing an Atmel tool.

Thanks
Kurt
Germany

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As I wrote, we *have* seen the bug on several occations.
Still, I have very rarely been able to reproduce it on my computer, that is the truth, plain and simple.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I hate to say it but you really cannot release 5.1 until you find/fix this one. Sure there are a lot of "irritations" in AS5 but this one, for my money, is the total show stopper. What point is there in a debugger that won't debug half the time? If I were you I'd set the entire test and development team on the task of creating projects and start/stop debugging until you can narrow down the circumstances that lead to this.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No source available.....
An annoying "feature" of Studio 5.0

Usualy one can just "continue" debugging and ignore the No source available.
I only know of one other case where the user could not launch debugging at all on a single CPU virtual host. He got it working by increasing CPU count to 2, which changed timing of some of the event processing.

Why do we see this page:
The legit reason for this is a break event somewhere where no source code is available.
During launch, a series of break events related to resetting the chip are expected and handled. Sometimes we get unexpected events because of:

1. Clocking issues: the chip cannot properly communicate with the debugger tool. The break address read by the tool may be wrong. Communication is affected by fuses (ckdiv8) , clock settings on the chip itself, and by the debugging clock settings on the debugger tool (where available). Many times "No source available" will go away with other debugger clock settings.
2. Timing Bugs: software assumptions gone wrong. We are continuously fixing (some :( ) of the bugs we discover, but are depending on the users to report and help us uncover more of these.

If you cannot debug at all (after e.g. a No Source Available msg), please contact us at avrbeta@atmel.com.

Each run of Studio will produce a log file in My Documents/Atmel . Please add the corresponding log file to the bug report, or send it to me in a PM. Thanks !

-dan

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Usually one can just "continue" debugging and ignore the No source available.

If only someone had said this previously in one of the many prior threads about this bug!

You are right that when the error occurs the "Browse to find source" option is ignored completely but if you use "Show disassembly" then let it run into the part with mixed source/asm then right-click and "Go to source code" you can get back to source level debugging. (could the IDE not do all this programatically and "hide" the bug?).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't understand what exactly might "timing bugs" and "software assumptions" mean, but I suspect a simulator should not be prone to bugs of that kind. And of course, "clocking issues" should be completely out of question.

https://www.avrfreaks.net/index.p...

JW

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I too have been suffering with the dreaded NSA - yesterday everything was working fine and then BOOM. I eventually traced it down to a particular function the first time it was called - the system would then go to never never land. Pausing the debugger gave the NSA. Prior to that point, pausing the debugger gave normal results. The function was delay_ms(xx) from the ASF timing/delay lib. The problem seem to be the way I had manually set the clocks, rather than using the PM functions. Once I changed that, everything seems to be working pretty much as expected - EXCEPT that my delay_ms(1) gives a 1.5nS delay rather than 1mS.
This is what I used to set up the clocks on my EVK-1101 board
pm_freq_param_t params;
params.cpu_f = 600000000;
params.pba_f = 30000000;
params.osc0_f = 12000000;
params.osc0_startup = 65000;
pm_configure_clocks(&params);
sysclk_init();
delay_init(sysclk_get_cpu_hz());

the delay_init gets the fcpu_hz as 115000.

Any ideas?
Thanks,
David

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry but what has that question got to do with the subject of my thread here?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Forgive me for intruding on your thread. The reasoning behind my thinking was I had found a source of my getting a NSA. Since this was the source of my NSA, perhaps someone could suggest why setting up the clocks correctly gave me a wrong delay.

It does appear I was mistaken about someone - or at least you - wanting to help – since the question was not exactly about NSA.

Again, I hope you will forgive my rudeness for posting on your thread – I will make sure that it never happens again.
Kind regards,
David
PS – I love the Internet, where people can act like bullies because they do not have to be face to face with a person to be rude – so much safer that way.

Topic locked