@@ -1757,6 +1757,7 @@ def __str__(self):
1757
1757
class GDBobj (ProbackupTest ):
1758
1758
def __init__ (self , cmd , verbose , attach = False ):
1759
1759
self .verbose = verbose
1760
+ self .output = ''
1760
1761
1761
1762
# Check gdb presense
1762
1763
try :
@@ -1801,7 +1802,8 @@ def __init__(self, cmd, verbose, attach=False):
1801
1802
# discard data from pipe,
1802
1803
# is there a way to do it a less derpy way?
1803
1804
while True :
1804
- line = self .proc .stdout .readline ()
1805
+ # line = self.proc.stdout.readline()
1806
+ line = self .get_line ()
1805
1807
1806
1808
if 'No such process' in line :
1807
1809
raise GdbException (line )
@@ -1811,6 +1813,12 @@ def __init__(self, cmd, verbose, attach=False):
1811
1813
else :
1812
1814
break
1813
1815
1816
+ def get_line (self ):
1817
+ line = self .proc .stdout .readline ()
1818
+ # self.output += repr(line) + '\n'
1819
+ self .output += line
1820
+ return line
1821
+
1814
1822
def kill (self ):
1815
1823
self .proc .kill ()
1816
1824
self .proc .wait ()
@@ -1932,10 +1940,8 @@ def continue_execution_until_break(self, ignore_count=0):
1932
1940
'Failed to continue execution until break.\n ' )
1933
1941
1934
1942
def stopped_in_breakpoint (self ):
1935
- output = []
1936
1943
while True :
1937
- line = self .proc .stdout .readline ()
1938
- output += [line ]
1944
+ line = self .get_line ()
1939
1945
if self .verbose :
1940
1946
print (line )
1941
1947
if line .startswith ('*stopped,reason="breakpoint-hit"' ):
@@ -1952,7 +1958,7 @@ def _execute(self, cmd, running=True):
1952
1958
1953
1959
# look for command we just send
1954
1960
while True :
1955
- line = self .proc . stdout . readline ()
1961
+ line = self .get_line ()
1956
1962
if self .verbose :
1957
1963
print (repr (line ))
1958
1964
@@ -1962,7 +1968,7 @@ def _execute(self, cmd, running=True):
1962
1968
break
1963
1969
1964
1970
while True :
1965
- line = self .proc . stdout . readline ()
1971
+ line = self .get_line ()
1966
1972
output += [line ]
1967
1973
if self .verbose :
1968
1974
print (repr (line ))
0 commit comments