Fix "gdbserver dp" test (#6424)

This commit is contained in:
Khairul Azhar Kasmiran 2026-05-30 07:14:18 +08:00 committed by GitHub
parent 691bd504c6
commit 4036da4576
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 8 deletions

View file

@ -92,7 +92,7 @@ jobs:
run: |
python3 -m pip install --user 'git+https://github.com/rizinorg/rz-pipe#egg=rzpipe&subdirectory=python' requests
sudo apt-get update
sudo apt-get --assume-yes install libc6 libc6-i386 debuginfod
sudo apt-get --assume-yes install libc6 libc6-i386 debuginfod gdbserver
- name: Run tests
env:

View file

@ -17,12 +17,12 @@ RUN
NAME=gdbserver dp
FILE=bins/elf/analysis/pie
CMDS=<<EOF
!scripts/gdbserver.py --port 12346 --multi --binary bins/elf/analysis/pie
oodf gdb://127.0.0.1:12346
!scripts/gdbserver.py --port 12347 --multi --binary bins/elf/analysis/pie
oodf gdb://127.0.0.1:12347
dp
EOF
REGEXP_FILTER_OUT=(^\s*[*-]\s*(\d+\s+ppid:\d+\s+uid:\d+))
REGEXP_FILTER_OUT=s.*pie
EXPECT=<<EOF
- 1 ppid:0 uid:0
s bins/elf/analysis/pie
EOF
RUN

View file

@ -14,8 +14,8 @@ run in parallel and may attempt to open the same port at the same time.
"""
import argparse
import os
import subprocess
import sys
def execute(cmd):
@ -60,11 +60,11 @@ def main():
print(output)
# Exit once gdbserver is ready for connections
if "Listening on port" in output:
sys.exit(0)
os._exit(0) # pylint: disable=protected-access
# gdbserver might fail to start if the port is taken
if "Can't bind address" in output:
print(output)
sys.exit(1)
os._exit(1) # pylint: disable=protected-access
if __name__ == "__main__":