Skip to content

Commit

Permalink
Revert pr214
Browse files Browse the repository at this point in the history
  • Loading branch information
sakhnik committed Jan 19, 2025
1 parent 7010f64 commit f54f491
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
16 changes: 1 addition & 15 deletions lib/gdb_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,14 @@ def __init__(self):
self.thrd = None
self.fallback_to_parsing = False
self.state = "stopped"
self.exited_or_ran = False

def handle_continue(event):
self.state = "running"
self.exited_or_ran = True
gdb.events.cont.connect(handle_continue)
def handle_stop(event):
self.state = "stopped"
def handle_exit(event):
self.state = "stopped"
self.exited_or_ran = True
gdb.events.stop.connect(handle_stop)
gdb.events.exited.connect(handle_exit)
gdb.events.exited.connect(handle_stop)

def invoke(self, arg, from_tty):
if not self.thrd:
Expand Down Expand Up @@ -89,9 +84,6 @@ def _handle_command(self, command, sock, addr):
elif request == "get-current-frame-location":
self._send_response(self._get_current_frame_location(),
req_id, sock, addr)
elif request == "has-exited-or-ran":
self._send_response(self._get_reset_exited_or_ran(),
req_id, sock, addr)
elif request == "handle-command":
# pylint: disable=broad-except
try:
Expand Down Expand Up @@ -127,12 +119,6 @@ def _send_response(self, response, req_id, sock, addr):
def _get_process_state(self):
return self.state

def _get_reset_exited_or_ran(self):
if (self.exited_or_ran):
self.exited_or_ran = False
return True
return False

def _get_current_frame_location(self):
try:
frame = gdb.selected_frame()
Expand Down
10 changes: 1 addition & 9 deletions lua/nvimgdb/backend/gdb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ function C.create_parser(actions, proxy)
local self = setmetatable({}, P)
self:_init(actions)

P.prev_fname = nil
P.prev_line = nil

function P:query_paused()
log.debug({"P:query_paused"})
coroutine.resume(coroutine.create(function()
Expand All @@ -43,12 +40,7 @@ function C.create_parser(actions, proxy)
if #location == 2 then
local fname = location[1]
local line = location[2]
if (fname ~= self.prev_fname or line ~= self.prev_line) or
proxy:query('has-exited-or-ran') then
self.prev_line = line
self.prev_fname = fname
self.actions:jump_to_source(fname, line)
end
self.actions:jump_to_source(fname, line)
end
end
self.actions:query_breakpoints()
Expand Down

0 comments on commit f54f491

Please sign in to comment.