History

Fix for lldb usage

lldb does not like function end and next function start at same pc

herman ten brugge committed 3 years ago

Commit 7cc1cc31 parent ab39d341 file · +6 −4Browse files

Unified · Split

tccdbg.c+6−4
@@ -971,7 +971,6 @@ ST_FUNC void tcc_debug_end(TCCState *s1) · 970 unmodified lines
971 tcc_free(dwarf_line.filename_table[i].name);971 tcc_free(dwarf_line.filename_table[i].name);
972 tcc_free(dwarf_line.filename_table);972 tcc_free(dwarf_line.filename_table);
973 973
974 dwarf_line_op(s1, DW_LNS_negate_stmt);
975 dwarf_line_op(s1, 0); // extended974 dwarf_line_op(s1, 0); // extended
976 dwarf_uleb128_op(s1, 1); // extended size975 dwarf_uleb128_op(s1, 1); // extended size
977 dwarf_line_op(s1, DW_LNE_end_sequence);976 dwarf_line_op(s1, DW_LNE_end_sequence);
@@ -1828,9 +1827,6 @@ ST_FUNC void tcc_debug_funcstart(TCCState *s1, Sym *sym) · 850 unmodified lines
1828 1827
1829 if (s1->dwarf) {1828 if (s1->dwarf) {
1830 tcc_debug_line(s1);1829 tcc_debug_line(s1);
1831 dwarf_line_op(s1, DW_LNS_negate_stmt);
1832 dwarf_line_op(s1, DW_LNS_copy);
1833 dwarf_line_op(s1, DW_LNS_negate_stmt);
1834 dwarf_info.func = sym;1830 dwarf_info.func = sym;
1835 dwarf_info.line = file->line_num;1831 dwarf_info.line = file->line_num;
1836 if (s1->do_backtrace) {1832 if (s1->do_backtrace) {
@@ -1868,9 +1864,15 @@ ST_FUNC void tcc_debug_prolog_epilog(TCCState *s1, int value) · 31 unmodified lines
1868/* put function size */1864/* put function size */
1869ST_FUNC void tcc_debug_funcend(TCCState *s1, int size)1865ST_FUNC void tcc_debug_funcend(TCCState *s1, int size)
1870{1866{
1867 /* lldb does not like function end and next function start at same pc */
1868 int min_instr_len;
1869
1871 if (!s1->do_debug)1870 if (!s1->do_debug)
1872 return;1871 return;
1872 min_instr_len = dwarf_line.last_pc == ind ? 0 : DWARF_MIN_INSTR_LEN;
1873 ind -= min_instr_len;
1873 tcc_debug_line(s1);1874 tcc_debug_line(s1);
1875 ind += min_instr_len;
1874 tcc_debug_stabn(s1, N_RBRAC, size);1876 tcc_debug_stabn(s1, N_RBRAC, size);
1875 if (s1->dwarf) {1877 if (s1->dwarf) {
1876 int func_sib = 0;1878 int func_sib = 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t