Skip to content

Commit 9b79839

Browse files
committed
coredump: fix fiber commands of gdb extension
Prior to this patch Tarantool GDB-extension failed during loading if `main_cord` symbol is optimized out. As a result fiber-related commands were not available, namely `info tt-fibers` and `tt-fiber`. Closes #1206
1 parent a9d884f commit 9b79839

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

cli/coredump/extensions/tarantool-gdb.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ def _init(cls):
15601560
if not hasattr(cls, '_containers_map'):
15611561
cls._containers_map = cls.__build_containers_map(cls._containers)
15621562

1563-
__symbol_re = re.compile('(\w+)(?:\s*\+\s*(\d+))?')
1563+
__symbol_re = re.compile(r'(\w+)(?:\s*\+\s*(\d+))?')
15641564

15651565
@classmethod
15661566
def lookup_entry_info(cls, address):
@@ -2582,16 +2582,14 @@ def fiber():
25822582

25832583

25842584
class Cord(object):
2585-
__main_cord_fibers = gdb.parse_and_eval('main_cord.alive')
2586-
__list_entry_info = RlistLut.lookup_entry_info(__main_cord_fibers.address)
2587-
25882585
def __init__(self):
25892586
self.__cord_ptr = cord()
25902587

25912588
def fibers(self):
25922589
fibers = self.__cord_ptr['alive']
25932590
fibers = Rlist(fibers.address)
2594-
fibers = map(lambda x: self.__class__.__list_entry_info.container_from_field(x), fibers)
2591+
list_entry_info = RlistLut.lookup_entry_info_by_container(ContainerFieldInfo("cord::alive"))
2592+
fibers = map(lambda x: list_entry_info.container_from_field(x), fibers)
25952593
return itertools.chain(fibers, [self.__cord_ptr['sched'].address])
25962594

25972595
def fiber(self, fid):

0 commit comments

Comments
 (0)