LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2010 The Go Authors. All rights reserved. | 1 // Copyright 2010 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // TODO/NICETOHAVE: | 5 // TODO/NICETOHAVE: |
6 // - eliminate DW_CLS_ if not used | 6 // - eliminate DW_CLS_ if not used |
7 // - package info in compilation units | 7 // - package info in compilation units |
8 // - assign global variables and types to their packages | 8 // - assign global variables and types to their packages |
9 // - gdb uses c syntax, meaning clumsy quoting is needed for go identifiers. e
g | 9 // - gdb uses c syntax, meaning clumsy quoting is needed for go identifiers. e
g |
10 // ptype struct '[]uint8' and qualifiers need to be quoted away | 10 // ptype struct '[]uint8' and qualifiers need to be quoted away |
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1597 epcs = s; | 1597 epcs = s; |
1598 newattr(dwfunc, DW_AT_high_pc, DW_CLS_ADDRESS, epc, (char*)s); | 1598 newattr(dwfunc, DW_AT_high_pc, DW_CLS_ADDRESS, epc, (char*)s); |
1599 if (s->version == 0) | 1599 if (s->version == 0) |
1600 newattr(dwfunc, DW_AT_external, DW_CLS_FLAG, 1, 0); | 1600 newattr(dwfunc, DW_AT_external, DW_CLS_FLAG, 1, 0); |
1601 | 1601 |
1602 if(s->pcln == nil) | 1602 if(s->pcln == nil) |
1603 continue; | 1603 continue; |
1604 | 1604 |
1605 finddebugruntimepath(s); | 1605 finddebugruntimepath(s); |
1606 | 1606 |
1607 » » pciterinit(&pcfile, &s->pcln->pcfile); | 1607 » » pciterinit(ctxt, &pcfile, &s->pcln->pcfile); |
1608 » » pciterinit(&pcline, &s->pcln->pcline); | 1608 » » pciterinit(ctxt, &pcline, &s->pcln->pcline); |
1609 epc = pc; | 1609 epc = pc; |
1610 while(!pcfile.done && !pcline.done) { | 1610 while(!pcfile.done && !pcline.done) { |
1611 if(epc - s->value >= pcfile.nextpc) { | 1611 if(epc - s->value >= pcfile.nextpc) { |
1612 pciternext(&pcfile); | 1612 pciternext(&pcfile); |
1613 continue; | 1613 continue; |
1614 } | 1614 } |
1615 if(epc - s->value >= pcline.nextpc) { | 1615 if(epc - s->value >= pcline.nextpc) { |
1616 pciternext(&pcline); | 1616 pciternext(&pcline); |
1617 continue; | 1617 continue; |
1618 } | 1618 } |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1754 if(s->pcln == nil) | 1754 if(s->pcln == nil) |
1755 continue; | 1755 continue; |
1756 | 1756 |
1757 fdeo = cpos(); | 1757 fdeo = cpos(); |
1758 // Emit a FDE, Section 6.4.1, starting wit a placeholder. | 1758 // Emit a FDE, Section 6.4.1, starting wit a placeholder. |
1759 LPUT(0); // length, must be multiple of PtrSize | 1759 LPUT(0); // length, must be multiple of PtrSize |
1760 LPUT(0); // Pointer to the CIE above, at offset 0 | 1760 LPUT(0); // Pointer to the CIE above, at offset 0 |
1761 addrput(0); // initial location | 1761 addrput(0); // initial location |
1762 addrput(0); // address range | 1762 addrput(0); // address range |
1763 | 1763 |
1764 » » for(pciterinit(&pcsp, &s->pcln->pcsp); !pcsp.done; pciternext(&p
csp)) | 1764 » » for(pciterinit(ctxt, &pcsp, &s->pcln->pcsp); !pcsp.done; pcitern
ext(&pcsp)) |
1765 putpccfadelta(pcsp.nextpc - pcsp.pc, PtrSize + pcsp.valu
e); | 1765 putpccfadelta(pcsp.nextpc - pcsp.pc, PtrSize + pcsp.valu
e); |
1766 | 1766 |
1767 fdesize = cpos() - fdeo - 4; // exclude the length field. | 1767 fdesize = cpos() - fdeo - 4; // exclude the length field. |
1768 pad = rnd(fdesize, PtrSize) - fdesize; | 1768 pad = rnd(fdesize, PtrSize) - fdesize; |
1769 strnput("", pad); | 1769 strnput("", pad); |
1770 fdesize += pad; | 1770 fdesize += pad; |
1771 | 1771 |
1772 // Emit the FDE header for real, Section 6.4.1. | 1772 // Emit the FDE header for real, Section 6.4.1. |
1773 cseek(fdeo); | 1773 cseek(fdeo); |
1774 LPUT(fdesize); | 1774 LPUT(fdesize); |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2415 | 2415 |
2416 newPEDWARFSection(".debug_abbrev", abbrevsize); | 2416 newPEDWARFSection(".debug_abbrev", abbrevsize); |
2417 newPEDWARFSection(".debug_line", linesize); | 2417 newPEDWARFSection(".debug_line", linesize); |
2418 newPEDWARFSection(".debug_frame", framesize); | 2418 newPEDWARFSection(".debug_frame", framesize); |
2419 newPEDWARFSection(".debug_info", infosize); | 2419 newPEDWARFSection(".debug_info", infosize); |
2420 newPEDWARFSection(".debug_pubnames", pubnamessize); | 2420 newPEDWARFSection(".debug_pubnames", pubnamessize); |
2421 newPEDWARFSection(".debug_pubtypes", pubtypessize); | 2421 newPEDWARFSection(".debug_pubtypes", pubtypessize); |
2422 newPEDWARFSection(".debug_aranges", arangessize); | 2422 newPEDWARFSection(".debug_aranges", arangessize); |
2423 newPEDWARFSection(".debug_gdb_scripts", gdbscriptsize); | 2423 newPEDWARFSection(".debug_gdb_scripts", gdbscriptsize); |
2424 } | 2424 } |
LEFT | RIGHT |