Encode function signatures properly in DWARF.
The signatures were previously stored as plain string.
The proper way in DWARF is to store them as structured tree of tags.
(for example, DW_TAG_subprogram containing DW_TAG_formal_parameter)
Note that this makes the debug sections smaller since DWARF
signatures are actually more efficient than just plain strings.
Change-Id: I6afbce28340570666d8674d07c0e324aad561dd5
diff --git a/compiler/dwarf/writer.h b/compiler/dwarf/writer.h
index 00b9dfa..d2add7f 100644
--- a/compiler/dwarf/writer.h
+++ b/compiler/dwarf/writer.h
@@ -114,9 +114,9 @@
data_->insert(data_->end(), value, value + strlen(value) + 1);
}
- void PushData(const void* ptr, size_t size) {
+ void PushData(const void* ptr, size_t num_bytes) {
const char* p = reinterpret_cast<const char*>(ptr);
- data_->insert(data_->end(), p, p + size);
+ data_->insert(data_->end(), p, p + num_bytes);
}
template<typename Vector2>
@@ -164,6 +164,10 @@
return data_;
}
+ size_t size() const {
+ return data_->size();
+ }
+
explicit Writer(Vector* buffer) : data_(buffer) { }
private: