aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debug/DwarfTypes.ml84
-rw-r--r--powerpc/PrintDiab.ml134
2 files changed, 141 insertions, 77 deletions
diff --git a/debug/DwarfTypes.ml b/debug/DwarfTypes.ml
index 65e819de..a5b5e3d1 100644
--- a/debug/DwarfTypes.ml
+++ b/debug/DwarfTypes.ml
@@ -78,53 +78,49 @@ type bound_value =
type dw_tag_array_type =
{
- array_type_file: constant option;
- array_type_line: constant option;
- array_type: reference;
+ array_type_decl_file: constant option;
+ array_type_decl_line: constant option;
+ array_type: reference;
}
type dw_tag_base_type =
{
- base_type_size: constant;
+ base_type_byte_size: constant;
base_type_encoding: encoding;
base_type_name: string;
}
type dw_tag_compile_unit =
{
- dw_at_base_types: reference option;
- dw_at_comp_dir: string;
- dw_at_identifier_case: identifier_case option;
- dw_at_high_pc: address;
- dw_at_language: language;
- dw_at_low_pc: address;
- dw_at_macro_info: constant option;
- dw_at_name: string;
- dw_at_producer: string;
- dw_at_stmt_list: constant option;
+ compile_unit_comp_dir: string;
+ compile_unit_high_pc: address;
+ compile_unit_low_pc: address;
+ compile_unit_language: language;
+ compile_unit_name: string;
+ compile_unit_producer: string;
+ compile_unit_stmt_list: constant option;
}
type dw_tag_const_type =
{
- dw_at_type: reference;
+ const_type: reference;
}
type dw_tag_enumeration_type =
{
- dw_at_decl_file: constant option;
- dw_at_decl_line: constant option;
- dw_at_byte_size: constant;
- dw_at_declaration: flag option;
- dw_at_name: string;
- dw_at_start_scope: constant option;
+ enumeration_decl_file: constant option;
+ enumeration_decl_line: constant option;
+ enumeration_byte_size: constant;
+ enumeration_declaration: flag option;
+ enumeration_name: string;
}
type dw_tag_enumerator =
{
- dw_at_decl_file: constant option;
- dw_at_decl_line: constant option;
- dw_at_const_value: constant;
- dw_at_name: string;
+ enumerator_decl_file: constant option;
+ enumerator_decl_line: constant option;
+ enumerator_value: constant;
+ enumerator_name: string;
}
type dw_tag_formal_parameter =
@@ -141,41 +137,41 @@ type dw_tag_formal_parameter =
type dw_tag_label =
{
- dw_at_low_pc: address;
- dw_at_name: string;
+ label_low_pc: address;
+ label_name: string;
}
type dw_tag_lexical_block =
{
- dw_at_high_pc: address;
- dw_at_low_pc: address;
+ lexical_block__high_pc: address;
+ lexical_block_low_pc: address;
}
type dw_tag_member =
{
- dw_at_decl_file: constant option;
- dw_at_decl_line: constant option;
- dw_at_byte_size: constant option;
- dw_at_bit_offset: constant option;
- dw_at_bit_size: constant option;
- dw_at_data_member_location: data_location_value option;
- dw_at_declaration: flag option;
- dw_at_name: string;
- dw_at_type: reference;
+ member_decl_file: constant option;
+ member_decl_line: constant option;
+ member_byte_size: constant option;
+ member_bit_offset: constant option;
+ member_bit_size: constant option;
+ member_data_member_location: data_location_value option;
+ member_declaration: flag option;
+ member_name: string;
+ member_type: reference;
}
type dw_tag_pointer_type =
{
- dw_at_type: reference;
+ pointer_type: reference;
}
type dw_tag_structure_type =
{
- dw_at_decl_file: constant option;
- dw_at_decl_line: constant option;
- dw_at_byte_size: constant;
- dw_at_declaration: flag option;
- dw_at_name: string;
+ structure_decl_file: constant option;
+ structure_decl_line: constant option;
+ structure_byte_size: constant;
+ structure_declaration: flag option;
+ structure_name: string;
}
type dw_tag_subprogram =
diff --git a/powerpc/PrintDiab.ml b/powerpc/PrintDiab.ml
index 6e1f1331..516b0038 100644
--- a/powerpc/PrintDiab.ml
+++ b/powerpc/PrintDiab.ml
@@ -113,49 +113,117 @@ module Diab_System =
in
Buffer.add_string buf s
- let add_abbr_uleb buf v =
+ let add_abbr_uleb v buf =
Buffer.add_string buf " .uleb128 ";
- Buffer.add_string buf v;
+ Buffer.add_string buf (string_of_int v);
Buffer.add_string buf "\n"
-
- let add_sibling buf =
- add_abbr_uleb buf "1";
- add_abbr_uleb buf "19"
-
- let add_decl_file buf =
- add_abbr_uleb buf "58";
- add_abbr_uleb buf "6"
+
+
+ let add_abbr_entry (v1,v2) buf =
+ add_abbr_uleb v1 buf;
+ add_abbr_uleb v2 buf
+
+ let add_sibling = add_abbr_entry (1,19)
+
+ let add_decl_file = add_abbr_entry (58,6)
- let add_decl_line buf =
- add_abbr_uleb buf "59";
- add_abbr_uleb buf "15"
+ let add_decl_line = add_abbr_entry (59,15)
- let add_type buf =
- add_abbr_uleb buf "73";
- add_abbr_uleb buf "16"
+ let add_type = add_abbr_entry (73,16)
- let add_array_type buf a_typ =
- (match a_typ.array_type_file with
- | None -> ()
- | Some _ -> add_decl_file buf);
- (match a_typ.array_type_line with
- | None -> ()
- | Some _ -> add_decl_line buf);
- add_type buf
-
- let add_name buf =
- add_abbr_uleb buf "3";
- add_abbr_uleb buf "8"
+ let add_name = add_abbr_entry (3,8)
+ let add_encoding = add_abbr_entry (62,11)
+
+ let add_byte_size = add_abbr_entry (11,11)
+
+ let add_high_pc = add_abbr_entry (18,1)
+
+ let add_low_pc = add_abbr_entry (17,1)
+
+ let add_stmt_list = add_abbr_entry (16,6)
+
+ let add_declaration = add_abbr_entry (60,12)
+
let abbrv_string_of_entity entity has_sibling =
let buf = Buffer.create 12 in
- let has_child = (match entity.children with [] -> false | _ -> true) in
+ let add_attr_some v f =
+ match v with
+ | None -> ()
+ | Some _ -> f buf in
+ let prologue id =
+ let has_child = match entity.children with
+ | [] -> false
+ | _ -> true in
+ add_abbr_uleb id buf;
+ add_byte buf has_child;
+ if has_sibling then add_sibling buf;
+ in
(match entity.tag with
| DW_TAG_array_type e ->
- (add_abbr_uleb buf "1";
- add_byte buf has_child;
- if has_sibling then add_sibling buf;
- add_array_type buf e)
+ prologue 1;
+ add_attr_some e.array_type_decl_file add_decl_file;
+ add_attr_some e.array_type_decl_line add_decl_line;
+ add_type buf
+ | DW_TAG_base_type _ ->
+ prologue 36;
+ add_encoding buf;
+ add_byte_size buf;
+ add_name buf
+ | DW_TAG_compile_unit e ->
+ prologue 17;
+ add_abbr_entry (27,8) buf;
+ add_high_pc buf;
+ add_low_pc buf;
+ add_abbr_entry (19,15) buf;
+ add_name buf;
+ add_abbr_entry (37,8) buf;
+ add_attr_some e.compile_unit_stmt_list add_stmt_list
+ | DW_TAG_const_type _ ->
+ prologue 40;
+ add_type buf
+ | DW_TAG_enumeration_type e ->
+ prologue 4;
+ add_attr_some e.enumeration_decl_file add_decl_file;
+ add_attr_some e.enumeration_decl_line add_decl_line;
+ add_byte_size buf;
+ add_name buf;
+ add_attr_some e.enumeration_declaration add_declaration
+ | DW_TAG_enumerator e ->
+ prologue 40;
+ add_attr_some e.enumerator_decl_file add_decl_file;
+ add_attr_some e.enumerator_decl_line add_decl_line;
+ add_abbr_entry (28,13) buf;
+ add_name buf
+ | DW_TAG_label _ ->
+ prologue 10;
+ add_low_pc buf;
+ add_name buf;
+ | DW_TAG_lexical_block _ ->
+ prologue 0xb;
+ add_high_pc buf;
+ add_low_pc buf
+ | DW_TAG_member e ->
+ prologue 0xd;
+ add_attr_some e.member_decl_file add_decl_file;
+ add_attr_some e.member_decl_line add_decl_line;
+ add_attr_some e.member_byte_size add_byte_size;
+ add_attr_some e.member_bit_offset (add_abbr_entry (13,11));
+ add_attr_some e.member_bit_size (add_abbr_entry (12,11));
+ add_attr_some e.member_data_member_location (add_abbr_entry (56,9));
+ add_attr_some e.member_declaration add_declaration;
+ add_name buf;
+ add_type buf
+ | DW_TAG_pointer_type _ ->
+ prologue 0xf;
+ add_type buf
+ | DW_TAG_structure_type e ->
+ prologue 0x13;
+ add_attr_some e.structure_decl_file add_decl_file;
+ add_attr_some e.structure_decl_line add_decl_line;
+ add_byte_size buf;
+ add_attr_some e.structure_declaration add_declaration;
+ add_name buf
| _ -> ());
Buffer.contents buf