Expose owned C breakpoints through shared MCP session

This commit is contained in:
Александр Петров
2026-09-17 23:03:59 +03:00
parent 0ade3b4821
commit 113d468c48
12 changed files with 78 additions and 16 deletions
+6
View File
@@ -225,6 +225,12 @@ class ServerTests(unittest.TestCase):
mine = controller.call('break_line',
{'file': '/src/main.c', 'line': 3, 'owner': 'mcp:a'})
other = controller.call('break_function', {'name': 'main', 'owner': 'mcp:b'})
controller.breakpoint_info[mine['id']]['guard_conditions'] = ['PG3 == 0x12']
listed = controller.call('list_breakpoints', {})['breakpoints']
self.assertEqual([(item['id'], item['owner']) for item in listed],
[(mine['id'], 'mcp:a'), (other['id'], 'mcp:b')])
self.assertEqual(listed[0]['locations'][0]['link_address'], 0x8100)
self.assertEqual(listed[0]['locations'][0]['bank_guard'], 'PG3 == 0x12')
self.assertTrue(controller._has_stop_breakpoint(session.where()))
with self.assertRaisesRegex(SessionError, 'не принадлежит'):
controller.call('clear_breakpoint', {'id': other['id'], 'owner': 'mcp:a'})