Not sure if MI has command to list source (actually I'd bet it does not). What it has is -stack-info-frame, which will return information about source file, line, etc..
Once you have that information it's just open file, read appropriate line, etc.
Question
Is there a way to ask GDB interface to print or list the code currently executing.
How can I do this (list code currently executing) via GDB?
Solution
Not sure if MI has command to list source (actually I'd bet it does not). What it has is -stack-info-frame, which will return information about source file, line, etc..
Once you have that information it's just open file, read appropriate line, etc.