This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug breakpoints/8357] GDB does not support work with labels (DW_TAG_label).


------- Additional Comments From mjw at redhat dot com  2009-02-04 21:42 -------
Simpler example that shows gcc does generate the DW_TAG_labels

$ cat t.c
#include <stdio.h>

int
main (int argc, char *argv)
{
  int i = 0;
  goto there;

here:
  printf("not here\n");
  i = 1;
  
there:
  printf("but here\n");
  if (i == 0)
    goto here;

done:
  return 0;
}

$ gcc -g -o t t.c

$ readelf -wi t | grep -A3 DW_TAG_label
 <2><b6>: Abbrev Number: 9 (DW_TAG_label)
    <b7>   DW_AT_name        : (indirect string, offset: 0x47): there	
    <bb>   DW_AT_decl_file   : 1	
    <bc>   DW_AT_decl_line   : 13	
--
 <2><c1>: Abbrev Number: 9 (DW_TAG_label)
    <c2>   DW_AT_name        : (indirect string, offset: 0x48): here	
    <c6>   DW_AT_decl_file   : 1	
    <c7>   DW_AT_decl_line   : 16	
--
 <2><cc>: Abbrev Number: 9 (DW_TAG_label)
    <cd>   DW_AT_name        : (indirect string, offset: 0xe): done	
    <d1>   DW_AT_decl_file   : 1	
    <d2>   DW_AT_decl_line   : 18	

$ gdb t
GNU gdb Fedora (6.8-29.fc10)
Copyright (C) 2008 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 "i386-redhat-linux-gnu"...
(gdb) break 10
Breakpoint 1 at 0x80483cf: file t.c, line 10.
(gdb) run
Starting program: /tmp/t 
but here

Breakpoint 1, main () at t.c:10
10	  printf("not here\n");
(gdb) break done
Function "done" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mjw at redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=8357

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]