set objcopy [gdb_find_objcopy]
set command "$objcopy --extract-dwo $object_file $dwo_file"
verbose -log "Executing $command"
- set result [catch "exec $command" output]
+ set result [catch {exec {*}$command} output]
verbose -log "objcopy --extract-dwo output: $output"
if { $result == 1 } {
return -1
set objcopy [gdb_find_objcopy]
set command "$objcopy --strip-dwo $filename"
verbose -log "Executing $command"
- set result [catch "exec $command" output]
+ set result [catch {exec {*}$command} output]
verbose -log "objcopy --strip-dwo output: $output"
if { $result == 1 } {
return -1
}
# Must be run on local host due to use of objcopy.
- if [is_remote host] {
+ if {[is_remote host]} {
return -1
}
set start $expect_out(1,string)
set end $expect_out(2,string)
- set func_length [expr $func_length + $end - $start]
+ set func_length [expr {$func_length + $end - $start}]
}
}
# Create two procedures for the tag. These call
# _handle_DW_TAG with the full tag name baked in; this
# does all the actual work.
+ # tclint-disable-next-line command-args
proc $name {{attrs {}} {children {}}} \
"_handle_DW_TAG $name \$attrs \$children"
error "duplicate proc name: from $name"
}
+ # tclint-disable-next-line command-args
proc $name2 {{attrs {}} {children {}}} \
"_handle_DW_TAG $name \$attrs \$children"
}
AT {
+ # tclint-disable-next-line command-args
proc $name {value {form {}}} \
"_handle_DW_AT $name \$value \$form"
}
upvar $name label_var
set label_var [new_label $text]
+ # tclint-disable-next-line command-args
proc ${name}: {args} [format {
define_label %s
uplevel $args
parse_options {{"is-64" "false"}}
- if [is_64_target] {
+ if {[is_64_target]} {
set _debug_rnglists_addr_size 8
} else {
set _debug_rnglists_addr_size 4
parse_options {{"is-64" "false"}}
- if [is_64_target] {
+ if {[is_64_target]} {
set _debug_loclists_addr_size 8
} else {
set _debug_loclists_addr_size 4
set flags 0
if { ${is-64} } {
- set flags [expr $flags | 0x1]
+ set flags [expr {$flags | 0x1}]
}
variable _mu_offset_size
- set _mu_offset_size [expr ${is-64} ? 8 : 4]
+ set _mu_offset_size [expr {${is-64} ? 8 : 4}]
if { ${debug-line-offset-label} != "" } {
- set flags [expr $flags | 0x2]
+ set flags [expr {$flags | 0x2}]
}
_op .byte $flags "flags"
if { ${debug-line-offset-label} != "" } {
- _op_offset [expr ${is-64} ? 8 : 4] ${debug-line-offset-label} \
+ _op_offset [expr {${is-64} ? 8 : 4}] ${debug-line-offset-label} \
"debug_line offset"
}
lappend _line_include_dirs $dirname
if { $Dwarf::_line_unit_version >= 5 } {
- return [expr [llength $_line_include_dirs] - 1]
+ return [expr {[llength $_line_include_dirs] - 1}]
} else {
return [llength $_line_include_dirs]
}
variable _line_file_names
lappend _line_file_names $filename $diridx
- set nr_filenames [expr [llength $_line_file_names] / 2]
+ set nr_filenames [expr {[llength $_line_file_names] / 2}]
if { $Dwarf::_line_unit_version >= 5 } {
- return [expr $nr_filenames - 1]
+ return [expr {$nr_filenames - 1}]
} else {
return $nr_filenames
}
string_ptr:
_op .ascii [_quote $dirname]
}
- _op_offset [expr $_line_is_64 ? 8 : 4] $string_ptr
+ _op_offset [expr {$_line_is_64 ? 8 : 4}] $string_ptr
}
}
}
_op .uleb128 0x0f \
"file_name_entry_format (form: DW_FORM_udata)"
- set nr_files [expr [llength $_line_file_names] / 2]
+ set nr_files [expr {[llength $_line_file_names] / 2}]
_op .byte $nr_files "file_names_count"
foreach { filename diridx } $_line_file_names {
string_ptr:
_op .ascii [_quote $filename]
}
- _op_offset [expr $_line_is_64 ? 8 : 4] $string_ptr
+ _op_offset [expr {$_line_is_64 ? 8 : 4}] $string_ptr
}
}
_op .uleb128 $diridx
variable _line
_op .byte 3 DW_LNS_advance_line
_op .sleb128 ${offset}
- set _line [expr $_line + $offset]
+ set _line [expr {$_line + $offset}]
}
# A pseudo line number program instruction, that can be used instead
# of DW_LNS_advance_line. Rather than writing:
- # {DW_LNS_advance_line [expr $line1 - 1]}
- # {DW_LNS_advance_line [expr $line2 - $line1]}
- # {DW_LNS_advance_line [expr $line3 - $line2]}
+ # {DW_LNS_advance_line [expr {$line1 - 1}]}
+ # {DW_LNS_advance_line [expr {$line2 - $line1}]}
+ # {DW_LNS_advance_line [expr {$line3 - $line2}]}
# we can just write:
# {line $line1}
# {line $line2}
# {line $line3}
proc line {line} {
variable _line
- set offset [expr $line - $_line]
+ set offset [expr {$line - $_line}]
DW_LNS_advance_line $offset
}
incr offset
# Padding.
- set tuple_size [expr 2 * $_addr_size + $_seg_size]
+ set tuple_size [expr {2 * $_addr_size + $_seg_size}]
if {$tuple_size == 0} {
set tuple_size 1
}
while { 1 } {
- if { [expr $offset % $tuple_size] == 0 } {
+ if { $offset % $tuple_size == 0 } {
break
}
_op .byte 0 "Pad to $tuple_size byte boundary"
}
proc _note {type name hexdata} {
- set namelen [expr [string length $name] + 1]
- set datalen [expr [string length $hexdata] / 2]
+ set namelen [expr {[string length $name] + 1}]
+ set datalen [expr {[string length $hexdata] / 2}]
# Name size.
_op .4byte $namelen
# Not "uplevel" here, because we want to evaluate in this
# namespace. This is somewhat bad because it means we can't
# readily refer to outer variables.
+ # tclint-disable-next-line command-args
eval $body
}