Skip to content

Commit cfd6e43

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 cfd6e43

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1313

1414
### Fixed
1515

16+
- `tt coredump`: adjust Tarantool GDB-extention to avoid load failure if `main_cord`
17+
symbol is `optimized out` in gdb session.
18+
1619
## [2.11.0] - 2025-09-10
1720

1821
The release supports Tarantool Config Storage in `tt cluster failover` commands and

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)