proc test_disassembly_only {} {
global mi_gdb_prompt
global hex
+ global decimal
# Test disassembly more only for the current function.
# Tests:
mi_gdb_test "print/x \$pc" "" ""
mi_gdb_test "111-data-disassemble -s \$pc -e \"\$pc + 12\" -- 0" \
- "111\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"4\",inst=\".*\"\},\{address=\"$hex\",func-name=\"main\",offset=\"8\",inst=\".*\"\},\{address=\"$hex\",func-name=\"main\",offset=\"12\",inst=\".*\"\}\}" \
+ "111\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\},\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\}" \
"data-disassemble from pc to pc+12 assembly only"
mi_gdb_test "222-data-disassemble -f basics.c -l 32 -- 0" \
- "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"100\",inst=\".*\"\}\}" \
+ "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}" \
"data-disassemble file & line, assembly only"
}
proc test_disassembly_lines_limit {} {
global mi_gdb_prompt
global hex
+ global decimal
# Test disassembly more only for the current function.
# Tests:
mi_gdb_test "print/x \$pc" "" ""
mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 20 -- 0" \
- "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"76\",inst=\".*\"\}\}" \
+ "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}" \
"data-disassemble file, line, number assembly only"
mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 0 -- 0" \
"data-disassemble file, line, number (zero lines) assembly only"
mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 50 -- 0" \
- "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"100\",inst=\".*\"\}\}" \
+ "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}" \
"data-disassemble file, line, number (more than main lines) assembly only"
}
# which we are now, even if we have specified that the range is only 2 insns.
#
mi_gdb_test "003-data-disassemble -s \$pc -e \"\$pc+4\" -- 1" \
- "003\\^done,asm_insns=\{src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"main\",offset=\"4\",inst=\".*\"\}.*\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}\}\}" \
+ "003\\^done,asm_insns=\{src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}\}\}" \
"data-disassemble range assembly mixed"
}
# Test disassembly more only for the current function.
# Tests:
- # -data-disassembly -f basics.c -l 32 -n 20 -- 0
- # -data-disassembly -f basics.c -l 32 -n 0 -- 0
- # -data-disassembly -f basics.c -l 32 -n 50 -- 0
+ # -data-disassembly -f basics.c -l 32 -n 20 -- 1
+ # -data-disassembly -f basics.c -l 32 -n 0 -- 1
+ # -data-disassembly -f basics.c -l 32 -n 50 -- 1
mi_gdb_test "print/x \$pc" "" ""
mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 20 -- 1" \
"break-watch operation"
mi_gdb_test "222-break-list" \
- "222\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"1\"\},bkpt=\{number=\"2\",type=\"watchpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",what=\"C\",times=\"0\"\}\}" \
+ "222\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"1\"\},bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",what=\"C\",times=\"0\"\}\}" \
"list of watchpoints"
}