Breakpad DWARF support: Remove extraneous breaks following returns in dwarf2reader.cc.

a=jimb, r=ted.mielczarek
Review URL: http://breakpad.appspot.com/343002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@911 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
jimblandy 2012-02-01 15:00:43 +00:00
parent 6eccfe32b1
commit 08b912f1ed

View file

@ -150,41 +150,32 @@ const char* CompilationUnit::SkipAttribute(const char* start,
&len)); &len));
start += len; start += len;
return SkipAttribute(start, form); return SkipAttribute(start, form);
break;
case DW_FORM_data1: case DW_FORM_data1:
case DW_FORM_flag: case DW_FORM_flag:
case DW_FORM_ref1: case DW_FORM_ref1:
return start + 1; return start + 1;
break;
case DW_FORM_ref2: case DW_FORM_ref2:
case DW_FORM_data2: case DW_FORM_data2:
return start + 2; return start + 2;
break;
case DW_FORM_ref4: case DW_FORM_ref4:
case DW_FORM_data4: case DW_FORM_data4:
return start + 4; return start + 4;
break;
case DW_FORM_ref8: case DW_FORM_ref8:
case DW_FORM_data8: case DW_FORM_data8:
return start + 8; return start + 8;
break;
case DW_FORM_string: case DW_FORM_string:
return start + strlen(start) + 1; return start + strlen(start) + 1;
break;
case DW_FORM_udata: case DW_FORM_udata:
case DW_FORM_ref_udata: case DW_FORM_ref_udata:
reader_->ReadUnsignedLEB128(start, &len); reader_->ReadUnsignedLEB128(start, &len);
return start + len; return start + len;
break;
case DW_FORM_sdata: case DW_FORM_sdata:
reader_->ReadSignedLEB128(start, &len); reader_->ReadSignedLEB128(start, &len);
return start + len; return start + len;
break;
case DW_FORM_addr: case DW_FORM_addr:
return start + reader_->AddressSize(); return start + reader_->AddressSize();
break;
case DW_FORM_ref_addr: case DW_FORM_ref_addr:
// DWARF2 and 3 differ on whether ref_addr is address size or // DWARF2 and 3 differ on whether ref_addr is address size or
// offset size. // offset size.
@ -194,27 +185,19 @@ const char* CompilationUnit::SkipAttribute(const char* start,
} else if (header_.version == 3) { } else if (header_.version == 3) {
return start + reader_->OffsetSize(); return start + reader_->OffsetSize();
} }
break;
case DW_FORM_block1: case DW_FORM_block1:
return start + 1 + reader_->ReadOneByte(start); return start + 1 + reader_->ReadOneByte(start);
break;
case DW_FORM_block2: case DW_FORM_block2:
return start + 2 + reader_->ReadTwoBytes(start); return start + 2 + reader_->ReadTwoBytes(start);
break;
case DW_FORM_block4: case DW_FORM_block4:
return start + 4 + reader_->ReadFourBytes(start); return start + 4 + reader_->ReadFourBytes(start);
break;
case DW_FORM_block: { case DW_FORM_block: {
uint64 size = reader_->ReadUnsignedLEB128(start, &len); uint64 size = reader_->ReadUnsignedLEB128(start, &len);
return start + size + len; return start + size + len;
} }
break;
case DW_FORM_strp: case DW_FORM_strp:
return start + reader_->OffsetSize(); return start + reader_->OffsetSize();
break;
default:
fprintf(stderr,"Unhandled form type");
} }
fprintf(stderr,"Unhandled form type"); fprintf(stderr,"Unhandled form type");
return NULL; return NULL;
@ -326,85 +309,71 @@ const char* CompilationUnit::ProcessAttribute(
&len)); &len));
start += len; start += len;
return ProcessAttribute(dieoffset, start, attr, form); return ProcessAttribute(dieoffset, start, attr, form);
break;
case DW_FORM_data1: case DW_FORM_data1:
case DW_FORM_flag: case DW_FORM_flag:
handler_->ProcessAttributeUnsigned(dieoffset, attr, form, handler_->ProcessAttributeUnsigned(dieoffset, attr, form,
reader_->ReadOneByte(start)); reader_->ReadOneByte(start));
return start + 1; return start + 1;
break;
case DW_FORM_data2: case DW_FORM_data2:
handler_->ProcessAttributeUnsigned(dieoffset, attr, form, handler_->ProcessAttributeUnsigned(dieoffset, attr, form,
reader_->ReadTwoBytes(start)); reader_->ReadTwoBytes(start));
return start + 2; return start + 2;
break;
case DW_FORM_data4: case DW_FORM_data4:
handler_->ProcessAttributeUnsigned(dieoffset, attr, form, handler_->ProcessAttributeUnsigned(dieoffset, attr, form,
reader_->ReadFourBytes(start)); reader_->ReadFourBytes(start));
return start + 4; return start + 4;
break;
case DW_FORM_data8: case DW_FORM_data8:
handler_->ProcessAttributeUnsigned(dieoffset, attr, form, handler_->ProcessAttributeUnsigned(dieoffset, attr, form,
reader_->ReadEightBytes(start)); reader_->ReadEightBytes(start));
return start + 8; return start + 8;
break;
case DW_FORM_string: { case DW_FORM_string: {
const char* str = start; const char* str = start;
handler_->ProcessAttributeString(dieoffset, attr, form, handler_->ProcessAttributeString(dieoffset, attr, form,
str); str);
return start + strlen(str) + 1; return start + strlen(str) + 1;
} }
break;
case DW_FORM_udata: case DW_FORM_udata:
handler_->ProcessAttributeUnsigned(dieoffset, attr, form, handler_->ProcessAttributeUnsigned(dieoffset, attr, form,
reader_->ReadUnsignedLEB128(start, reader_->ReadUnsignedLEB128(start,
&len)); &len));
return start + len; return start + len;
break;
case DW_FORM_sdata: case DW_FORM_sdata:
handler_->ProcessAttributeSigned(dieoffset, attr, form, handler_->ProcessAttributeSigned(dieoffset, attr, form,
reader_->ReadSignedLEB128(start, &len)); reader_->ReadSignedLEB128(start, &len));
return start + len; return start + len;
break;
case DW_FORM_addr: case DW_FORM_addr:
handler_->ProcessAttributeUnsigned(dieoffset, attr, form, handler_->ProcessAttributeUnsigned(dieoffset, attr, form,
reader_->ReadAddress(start)); reader_->ReadAddress(start));
return start + reader_->AddressSize(); return start + reader_->AddressSize();
break;
case DW_FORM_ref1: case DW_FORM_ref1:
handler_->ProcessAttributeReference(dieoffset, attr, form, handler_->ProcessAttributeReference(dieoffset, attr, form,
reader_->ReadOneByte(start) reader_->ReadOneByte(start)
+ offset_from_section_start_); + offset_from_section_start_);
return start + 1; return start + 1;
break;
case DW_FORM_ref2: case DW_FORM_ref2:
handler_->ProcessAttributeReference(dieoffset, attr, form, handler_->ProcessAttributeReference(dieoffset, attr, form,
reader_->ReadTwoBytes(start) reader_->ReadTwoBytes(start)
+ offset_from_section_start_); + offset_from_section_start_);
return start + 2; return start + 2;
break;
case DW_FORM_ref4: case DW_FORM_ref4:
handler_->ProcessAttributeReference(dieoffset, attr, form, handler_->ProcessAttributeReference(dieoffset, attr, form,
reader_->ReadFourBytes(start) reader_->ReadFourBytes(start)
+ offset_from_section_start_); + offset_from_section_start_);
return start + 4; return start + 4;
break;
case DW_FORM_ref8: case DW_FORM_ref8:
handler_->ProcessAttributeReference(dieoffset, attr, form, handler_->ProcessAttributeReference(dieoffset, attr, form,
reader_->ReadEightBytes(start) reader_->ReadEightBytes(start)
+ offset_from_section_start_); + offset_from_section_start_);
return start + 8; return start + 8;
break;
case DW_FORM_ref_udata: case DW_FORM_ref_udata:
handler_->ProcessAttributeReference(dieoffset, attr, form, handler_->ProcessAttributeReference(dieoffset, attr, form,
reader_->ReadUnsignedLEB128(start, reader_->ReadUnsignedLEB128(start,
&len) &len)
+ offset_from_section_start_); + offset_from_section_start_);
return start + len; return start + len;
break;
case DW_FORM_ref_addr: case DW_FORM_ref_addr:
// DWARF2 and 3 differ on whether ref_addr is address size or // DWARF2 and 3 differ on whether ref_addr is address size or
// offset size. // offset size.
@ -426,28 +395,24 @@ const char* CompilationUnit::ProcessAttribute(
datalen); datalen);
return start + 1 + datalen; return start + 1 + datalen;
} }
break;
case DW_FORM_block2: { case DW_FORM_block2: {
uint64 datalen = reader_->ReadTwoBytes(start); uint64 datalen = reader_->ReadTwoBytes(start);
handler_->ProcessAttributeBuffer(dieoffset, attr, form, start + 2, handler_->ProcessAttributeBuffer(dieoffset, attr, form, start + 2,
datalen); datalen);
return start + 2 + datalen; return start + 2 + datalen;
} }
break;
case DW_FORM_block4: { case DW_FORM_block4: {
uint64 datalen = reader_->ReadFourBytes(start); uint64 datalen = reader_->ReadFourBytes(start);
handler_->ProcessAttributeBuffer(dieoffset, attr, form, start + 4, handler_->ProcessAttributeBuffer(dieoffset, attr, form, start + 4,
datalen); datalen);
return start + 4 + datalen; return start + 4 + datalen;
} }
break;
case DW_FORM_block: { case DW_FORM_block: {
uint64 datalen = reader_->ReadUnsignedLEB128(start, &len); uint64 datalen = reader_->ReadUnsignedLEB128(start, &len);
handler_->ProcessAttributeBuffer(dieoffset, attr, form, start + len, handler_->ProcessAttributeBuffer(dieoffset, attr, form, start + len,
datalen); datalen);
return start + datalen + len; return start + datalen + len;
} }
break;
case DW_FORM_strp: { case DW_FORM_strp: {
assert(string_buffer_ != NULL); assert(string_buffer_ != NULL);
@ -459,11 +424,8 @@ const char* CompilationUnit::ProcessAttribute(
str); str);
return start + reader_->OffsetSize(); return start + reader_->OffsetSize();
} }
break;
default:
fprintf(stderr, "Unhandled form type");
} }
fprintf(stderr, "Unhandled form type"); fprintf(stderr, "Unhandled form type\n");
return NULL; return NULL;
} }