Skip to content

Commit 0da3d19

Browse files
committed
Revert pr214 #213
1 parent 306ddad commit 0da3d19

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

lib/gdb_commands.py

+1-15
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,14 @@ def __init__(self):
2929
self.thrd = None
3030
self.fallback_to_parsing = False
3131
self.state = "stopped"
32-
self.exited_or_ran = False
3332

3433
def handle_continue(event):
3534
self.state = "running"
36-
self.exited_or_ran = True
3735
gdb.events.cont.connect(handle_continue)
3836
def handle_stop(event):
3937
self.state = "stopped"
40-
def handle_exit(event):
41-
self.state = "stopped"
42-
self.exited_or_ran = True
4338
gdb.events.stop.connect(handle_stop)
44-
gdb.events.exited.connect(handle_exit)
39+
gdb.events.exited.connect(handle_stop)
4540

4641
def invoke(self, arg, from_tty):
4742
if not self.thrd:
@@ -89,9 +84,6 @@ def _handle_command(self, command, sock, addr):
8984
elif request == "get-current-frame-location":
9085
self._send_response(self._get_current_frame_location(),
9186
req_id, sock, addr)
92-
elif request == "has-exited-or-ran":
93-
self._send_response(self._get_reset_exited_or_ran(),
94-
req_id, sock, addr)
9587
elif request == "handle-command":
9688
# pylint: disable=broad-except
9789
try:
@@ -127,12 +119,6 @@ def _send_response(self, response, req_id, sock, addr):
127119
def _get_process_state(self):
128120
return self.state
129121

130-
def _get_reset_exited_or_ran(self):
131-
if (self.exited_or_ran):
132-
self.exited_or_ran = False
133-
return True
134-
return False
135-
136122
def _get_current_frame_location(self):
137123
try:
138124
frame = gdb.selected_frame()

lua/nvimgdb/backend/gdb.lua

+1-9
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ function C.create_parser(actions, proxy)
2929
local self = setmetatable({}, P)
3030
self:_init(actions)
3131

32-
P.prev_fname = nil
33-
P.prev_line = nil
34-
3532
function P:query_paused()
3633
log.debug({"P:query_paused"})
3734
coroutine.resume(coroutine.create(function()
@@ -43,12 +40,7 @@ function C.create_parser(actions, proxy)
4340
if #location == 2 then
4441
local fname = location[1]
4542
local line = location[2]
46-
if (fname ~= self.prev_fname or line ~= self.prev_line) or
47-
proxy:query('has-exited-or-ran') then
48-
self.prev_line = line
49-
self.prev_fname = fname
50-
self.actions:jump_to_source(fname, line)
51-
end
43+
self.actions:jump_to_source(fname, line)
5244
end
5345
end
5446
self.actions:query_breakpoints()

0 commit comments

Comments
 (0)