Changeset View
Changeset View
Standalone View
Standalone View
contrib/gdb/gdb/dwarf2-frame.c
Show First 20 Lines • Show All 387 Lines • ▼ Show 20 Lines | xfree (old_rs); | ||||
break; | break; | ||||
case DW_CFA_def_cfa_register: | case DW_CFA_def_cfa_register: | ||||
insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->cfa_reg); | insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->cfa_reg); | ||||
fs->cfa_how = CFA_REG_OFFSET; | fs->cfa_how = CFA_REG_OFFSET; | ||||
break; | break; | ||||
case DW_CFA_def_cfa_offset: | case DW_CFA_def_cfa_offset: | ||||
insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->cfa_offset); | insn_ptr = read_uleb128 (insn_ptr, insn_end, (unsigned long *)&fs->cfa_offset); | ||||
/* cfa_how deliberately not set. */ | /* cfa_how deliberately not set. */ | ||||
break; | break; | ||||
case DW_CFA_nop: | case DW_CFA_nop: | ||||
break; | break; | ||||
case DW_CFA_def_cfa_expression: | case DW_CFA_def_cfa_expression: | ||||
insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->cfa_exp_len); | insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->cfa_exp_len); | ||||
▲ Show 20 Lines • Show All 926 Lines • ▼ Show 20 Lines | read_signed_leb128 (unit->abfd, buf, &bytes_read); | ||||
if (cie->saw_z_augmentation) | if (cie->saw_z_augmentation) | ||||
{ | { | ||||
ULONGEST length; | ULONGEST length; | ||||
length = read_unsigned_leb128 (unit->abfd, buf, &bytes_read); | length = read_unsigned_leb128 (unit->abfd, buf, &bytes_read); | ||||
buf += bytes_read; | buf += bytes_read; | ||||
if (buf > end) | if (buf > end) | ||||
return NULL; | return NULL; | ||||
cie->initial_instructions = buf + length; | cie->initial_instructions = (unsigned char *)(buf + length); | ||||
augmentation++; | augmentation++; | ||||
} | } | ||||
while (*augmentation) | while (*augmentation) | ||||
{ | { | ||||
/* "L" indicates a byte showing how the LSDA pointer is encoded. */ | /* "L" indicates a byte showing how the LSDA pointer is encoded. */ | ||||
if (*augmentation == 'L') | if (*augmentation == 'L') | ||||
{ | { | ||||
/* Skip. */ | /* Skip. */ | ||||
buf++; | buf++; | ||||
augmentation++; | augmentation++; | ||||
} | } | ||||
/* "R" indicates a byte indicating how FDE addresses are encoded. */ | /* "R" indicates a byte indicating how FDE addresses are encoded. */ | ||||
else if (*augmentation == 'R') | else if (*augmentation == 'R') | ||||
{ | { | ||||
cie->encoding = *buf++; | cie->encoding = *buf++; | ||||
augmentation++; | augmentation++; | ||||
} | } | ||||
/* "P" indicates a personality routine in the CIE augmentation. */ | /* "P" indicates a personality routine in the CIE augmentation. */ | ||||
else if (*augmentation == 'P') | else if (*augmentation == 'P') | ||||
{ | { | ||||
/* Skip. */ | /* Skip. */ | ||||
buf += size_of_encoded_value (*buf++); | buf += size_of_encoded_value (*buf); | ||||
buf++; | |||||
augmentation++; | augmentation++; | ||||
} | } | ||||
/* Otherwise we have an unknown augmentation. | /* Otherwise we have an unknown augmentation. | ||||
Bail out unless we saw a 'z' prefix. */ | Bail out unless we saw a 'z' prefix. */ | ||||
else | else | ||||
{ | { | ||||
if (cie->initial_instructions == NULL) | if (cie->initial_instructions == NULL) | ||||
return end; | return end; | ||||
/* Skip unknown augmentations. */ | /* Skip unknown augmentations. */ | ||||
buf = cie->initial_instructions; | buf = (char *)(cie->initial_instructions); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
cie->initial_instructions = buf; | cie->initial_instructions = (unsigned char *)buf; | ||||
cie->end = end; | cie->end =(unsigned char *)end; | ||||
add_cie (unit, cie); | add_cie (unit, cie); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
/* This is a FDE. */ | /* This is a FDE. */ | ||||
struct dwarf2_fde *fde; | struct dwarf2_fde *fde; | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | can skip the whole thing. */ | ||||
ULONGEST length; | ULONGEST length; | ||||
length = read_unsigned_leb128 (unit->abfd, buf, &bytes_read); | length = read_unsigned_leb128 (unit->abfd, buf, &bytes_read); | ||||
buf += bytes_read + length; | buf += bytes_read + length; | ||||
if (buf > end) | if (buf > end) | ||||
return NULL; | return NULL; | ||||
} | } | ||||
fde->instructions = buf; | fde->instructions = (unsigned char *)buf; | ||||
fde->end = end; | fde->end = (unsigned char *)end; | ||||
add_fde (unit, fde); | add_fde (unit, fde); | ||||
} | } | ||||
return end; | return end; | ||||
} | } | ||||
/* Read a CIE or FDE in BUF and decode it. */ | /* Read a CIE or FDE in BUF and decode it. */ | ||||
▲ Show 20 Lines • Show All 172 Lines • Show Last 20 Lines |