diff mbox

[1/6] New proc _handle_attribute

Message ID 1414195968-3333-2-git-send-email-yao@codesourcery.com
State New
Headers show

Commit Message

Yao Qi Oct. 25, 2014, 12:12 a.m. UTC
This patch is to move some code to a new procedure _handle_attribute,
which will be used in my following patches.

gdb/testsuite:

2014-10-24  Yao Qi  <yao@codesourcery.com>

	* lib/dwarf.exp (_handle_DW_TAG): Move some code to ...
	(_handle_attribute): New procedure.
---
 gdb/testsuite/lib/dwarf.exp | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

Comments

Doug Evans Nov. 4, 2014, 10:48 p.m. UTC | #1
Yao Qi writes:
 > This patch is to move some code to a new procedure _handle_attribute,
 > which will be used in my following patches.
 > 
 > gdb/testsuite:
 > 
 > 2014-10-24  Yao Qi  <yao@codesourcery.com>
 > 
 > 	* lib/dwarf.exp (_handle_DW_TAG): Move some code to ...
 > 	(_handle_attribute): New procedure.

LGTM
diff mbox

Patch

diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index 1483271..4986f83 100644
--- a/gdb/testsuite/lib/dwarf.exp
+++ b/gdb/testsuite/lib/dwarf.exp
@@ -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 {