@@ -60,6 +60,7 @@ namespace xpyt
6060 , m_debugpy_port(" " )
6161 , m_debugger_config(debugger_config)
6262 {
63+ std::cout << " Debugger Config: " << m_debugger_config << std::endl;
6364 m_debugpy_port = xeus::find_free_port (100 , 5678 , 5900 );
6465 register_request_handler (" inspectVariables" , std::bind (&debugger::inspect_variables_request, this , _1), false );
6566 register_request_handler (" richInspectVariables" , std::bind (&debugger::rich_inspect_variables_request, this , _1), false );
@@ -68,6 +69,25 @@ namespace xpyt
6869 register_request_handler (" copyToGlobals" , std::bind (&debugger::copy_to_globals_request, this , _1), true );
6970 register_request_handler (" modules" , std::bind (&debugger::modules, this , _1), false );
7071
72+ // Load internal module paths from debugger_config
73+ if (m_debugger_config.contains (" internalModulePaths" ))
74+ {
75+ for (const auto & p : m_debugger_config[" internalModulePaths" ])
76+ {
77+ m_internal_modules.push_back (p.get <std::string>());
78+ }
79+ }
80+
81+ // Load options
82+ if (m_debugger_config.contains (" justMyCode" ))
83+ {
84+ m_just_my_code = m_debugger_config[" justMyCode" ].get <bool >();
85+ }
86+
87+ if (m_debugger_config.contains (" filterInternalFrames" ))
88+ {
89+ m_filter_internal_frames = m_debugger_config[" filterInternalFrames" ].get <bool >();
90+ }
7191 }
7292
7393 debugger::~debugger ()
@@ -176,6 +196,24 @@ namespace xpyt
176196 {" port" , std::stoi (m_debugpy_port)}
177197 };
178198 new_message[" arguments" ][" logToFile" ] = true ;
199+
200+ // Add DebugStdLib when not just-my-code
201+ if (!m_just_my_code)
202+ {
203+ new_message[" arguments" ][" debugOptions" ] = {" DebugStdLib" };
204+ }
205+
206+ // Dynamic skip rules
207+ if (m_filter_internal_frames)
208+ {
209+ nl::json rules = nl::json::array ();
210+ for (const auto & path : m_internal_modules)
211+ {
212+ rules.push_back ({{" path" , path}, {" include" , false }});
213+ }
214+ new_message[" arguments" ][" rules" ] = rules;
215+ }
216+
179217 return forward_message (new_message);
180218 }
181219
0 commit comments