Qiling gdbserver not handling stepi instruction

Đang mở
#1,538 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python

Hướng nghiên cứu

Start in gdb.py at handle_s and reproduce the issue by using the si command against an example. Check the gdbserver response after single-stepping and verify that an active emulation returns SIGTRAP rather than SIGTERM. Also investigate whether the same condition affects breakpoint handling, as reported but not confirmed in the issue.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

gdbserver

Describe the bug
The gdbserver is sending a SIGTERM each time I perform the si command and this cause my gdbclient to consider the program exited although it's not.

Sample Code
Not related to any particular code, would happen with all examples.

Expected behavior
I think that the gdbserver should send the SIGTRAP signal instead.

Addtionnal context
I debugged a bit the gdbserver and I think that the cause is below : in gdb.py

def handle_s(subcmd: str) -> Reply:
  """Perform a single step.
  """
  
  self.gdb.resume_emu(steps=1)
  
  # if emulation has been stopped, signal program termination
# =====  The condition is always True  ===
 if self.ql.emu_state is QL_STATE.STOPPED: 
   return f'S{SIGTERM:02x}'
# ====================================================================
  # otherwise, this is just single stepping
  return f'S{SIGTRAP:02x}'

Wonder if this condition is useful in a particular case that is not related to mine. I've tested to comment these two lines and everything works perfectly fine after that. I think it also causes other bugs with breakpoint but not so sure and didn't have the time to verify this point.

Additional context
I worked with the dev branch.

Ngôn ngữ chính
Python
Star
6.2k
Fork
806
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của qilingframework/qiling

Tất cả issue của qilingframework/qiling

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.