|
|
|
@ -26,13 +26,12 @@ def test_loads_binary_without_crashing():
|
|
|
|
compile_binary(BINARY_SOURCE, BINARY)
|
|
|
|
compile_binary(BINARY_SOURCE, BINARY)
|
|
|
|
output = run_gdb_with_script(binary=BINARY).splitlines()
|
|
|
|
output = run_gdb_with_script(binary=BINARY).splitlines()
|
|
|
|
|
|
|
|
|
|
|
|
expected = [
|
|
|
|
for h in HELLO:
|
|
|
|
"Reading symbols from %s..." % BINARY,
|
|
|
|
assert h in output
|
|
|
|
"(No debugging symbols found in %s)" % BINARY,
|
|
|
|
assert any("Reading symbols from %s..." % BINARY in line for line in output)
|
|
|
|
]
|
|
|
|
# Old GDB says f"(no debugging symbols found)"
|
|
|
|
expected += HELLO
|
|
|
|
# New GDB says f"(No debugging symbols found in ${BINARY})"
|
|
|
|
|
|
|
|
assert any("(no debugging symbols found" in line.lower() for line in output)
|
|
|
|
assert all(item in output for item in expected)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_loads_binary_with_core_without_crashing():
|
|
|
|
def test_loads_binary_with_core_without_crashing():
|
|
|
|
@ -44,14 +43,13 @@ def test_loads_binary_with_core_without_crashing():
|
|
|
|
assert os.path.isfile(CORE)
|
|
|
|
assert os.path.isfile(CORE)
|
|
|
|
output = run_gdb_with_script(binary=BINARY, core=CORE).splitlines()
|
|
|
|
output = run_gdb_with_script(binary=BINARY, core=CORE).splitlines()
|
|
|
|
|
|
|
|
|
|
|
|
expected = [
|
|
|
|
assert any("Reading symbols from %s..." % BINARY in line for line in output)
|
|
|
|
"Reading symbols from %s..." % BINARY,
|
|
|
|
# Old GDB says f"(no debugging symbols found)"
|
|
|
|
"(No debugging symbols found in %s)" % BINARY,
|
|
|
|
# New GDB says f"(No debugging symbols found in ${BINARY})"
|
|
|
|
"Program terminated with signal SIGFPE, Arithmetic exception.",
|
|
|
|
assert any("(no debugging symbols found" in line.lower() for line in output)
|
|
|
|
]
|
|
|
|
assert "Program terminated with signal SIGFPE, Arithmetic exception." in output
|
|
|
|
expected += HELLO
|
|
|
|
for h in HELLO:
|
|
|
|
|
|
|
|
assert h in output
|
|
|
|
assert all(item in output for item in expected)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lwp_line = re.compile(r"^\[New LWP \d+\]$")
|
|
|
|
lwp_line = re.compile(r"^\[New LWP \d+\]$")
|
|
|
|
assert any([lwp_line.match(line) for line in output])
|
|
|
|
assert any([lwp_line.match(line) for line in output])
|
|
|
|
|