New proc _handle_attribute
authorYao Qi <yao@codesourcery.com>
Fri, 14 Nov 2014 00:53:08 +0000 (08:53 +0800)
committerYao Qi <yao@codesourcery.com>
Fri, 14 Nov 2014 00:55:06 +0000 (08:55 +0800)
This patch is to move some code to a new procedure _handle_attribute,
which will be used in my following patches.

gdb/testsuite:

2014-11-14  Yao Qi  <yao@codesourcery.com>

* lib/dwarf.exp (_handle_DW_TAG): Move some code to ...
(_handle_attribute): New procedure.

gdb/testsuite/ChangeLog
gdb/testsuite/lib/dwarf.exp

index 405548e3944bd54c779ca81ea6a284c6209e03a6..d46f3cc2c6eaad44885acc0a177fa82962dba0e1 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-14  Yao Qi  <yao@codesourcery.com>
+
+       * lib/dwarf.exp (_handle_DW_TAG): Move some code to ...
+       (_handle_attribute): New procedure.
+
 2014-11-13  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
        * gdb.ada/cond_lang/foo.c (callme): Add return type.
index 1483271949075c4295201a3d5b92a48b0c124c0b..4986f838586a43b52687a4576922cd83165b1f32 100644 (file)
@@ -461,6 +461,18 @@ namespace eval Dwarf {
        return $name
     }
 
+    proc _handle_attribute { attr_name attr_value attr_form } {
+       variable _abbrev_section
+       variable _constants
+
+       _handle_DW_FORM $attr_form $attr_value
+
+       _defer_output $_abbrev_section {
+           _op .uleb128 $_constants($attr_name) $attr_name
+           _op .uleb128 $_constants($attr_form) $attr_form
+       }
+    }
+
     proc _handle_DW_TAG {tag_name {attrs {}} {children {}}} {
        variable _abbrev_section
        variable _abbrev_num
@@ -489,12 +501,7 @@ namespace eval Dwarf {
            }
            set attr_form [_map_name $attr_form _FORM]
 
-           _handle_DW_FORM $attr_form $attr_value
-
-           _defer_output $_abbrev_section {
-               _op .uleb128 $_constants($attr_name) $attr_name
-               _op .uleb128 $_constants($attr_form) $attr_form
-           }
+           _handle_attribute $attr_name $attr_value $attr_form
        }
 
        _defer_output $_abbrev_section {