# default = default
# fission 0|1 - boolean indicating if generating Fission debug info
# default = 0
+ # label <label>
+ # - string indicating label to be defined at the start
+ # of the CU header.
+ # default = ""
# BODY is Tcl code that emits the DIEs which make up the body of
# the CU. It is evaluated in the caller's context.
proc cu {options body} {
set _cu_is_fission 0
set section ".debug_info"
set _abbrev_section ".debug_abbrev"
+ set label ""
foreach { name value } $options {
set value [uplevel 1 "subst \"$value\""]
version { set _cu_version $value }
addr_size { set _cu_addr_size $value }
fission { set _cu_is_fission $value }
+ label { set label $value }
default { error "unknown option $name" }
}
}
set start_label [_compute_label "cu${cu_num}_start"]
set end_label [_compute_label "cu${cu_num}_end"]
+ if { $label != "" } {
+ upvar $label my_label
+ set my_label $_cu_label
+ }
+
define_label $_cu_label
if {$is_64} {
_op .4byte 0xffffffff