Opened 11 years ago
Last modified 7 years ago
#2421 new enhancement
OMEdit gdb debugging - desired features
Reported by: | Adrian Pop | Owned by: | Adeel Asghar |
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | OMEdit | Version: | trunk |
Keywords: | debugging | Cc: | Adrian Pop, per, Peter Fritzson, Martin Sjölund, Alachew Mengist |
Description (last modified by )
I would really like to extend the GDB debugger features in
OMEdit compared to MDT. I've been playing a lot with the MDT
debugging and while is quite good, it can be way better which
would support way more effective debugging.
Per and Martin, add more to this list if you want.
Adeel, I can make it a ticket out of this if you want -> done :)
- have a user console to send written commands to gdb (for advanced
users like Martin and me). You can use
-interpreter-exec console "command"
http://www.sourceware.org/gdb/onlinedocs/gdb.html#g_t_002dinterpreter_002dexec
- have an user option in OMEdit debugging settings to not remove frames that are for .c/.cpp files. Note that some of these files are quite large (100Mb+) and should not be fully opened in OMEdit just display 100 lines above and below the breakpoint line.
- when your program cycles and you suspend it sometimes it switches threads so you get a different stack that you want. have a way to switch the threads or display all threads instead of just the one executing .mo code.
- have a way to search the (tree-like) local variables for strings, record names, record component names if possible with regular expressions.
- have a way to break only if a local variable contains certain record name or string. sometimes a function is executed a lot of times but you're only interested if the input/local variable path (Absyn.Path) contains certain string. currently you have to suffer through stopping *a lot* of times until you reach the point you're interested in.
- have a toggle button that enables timings for step in,
step over run commands. if you send command:
-enable-timings [yes | no]
then when you do step over or run gdb measures time until the next break event and report it then in this way:time={wallclock="0.05185",user="0.00800",system="0.00000"
}. the execution time until the next breakpoint is hit can then be displayed somewhere.
Change History (16)
comment:1 by , 11 years ago
Description: | modified (diff) |
---|
comment:2 by , 11 years ago
Cc: | added |
---|
comment:3 by , 10 years ago
follow-up: 5 comment:4 by , 10 years ago
The following needs to be taken care of:
- It is not possible to start the process paused (to add breakpoints easily)
- It is not possible to browse the functions of the executable to choose one of them to add a breakpoint at
- When browsing for a class (function/record) to break at, the debugger creates a breakpoint at line 0 in the file. Instead of simply adding a breakpoint at the function (for example, add a breakpoint for class Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.from_nxy should break at
omc_Modelica_Mechanics_MultiBody_Frames_TransformationMatrices_from__nxy
) - C frames are not shown, even when stopping in a C frame (like an external function causing a segmentation fault)
- Launching the debugger does not seem to run with the same command-line arguments as when simulating normally
- Clicking the pause button does not suspend the executable
follow-up: 6 comment:5 by , 10 years ago
Replying to sjoelund.se:
The following needs to be taken care of:
- It is not possible to start the process paused (to add breakpoints easily)
What do you mean?
- It is not possible to browse the functions of the executable to choose one of them to add a breakpoint at
- When browsing for a class (function/record) to break at, the debugger creates a breakpoint at line 0 in the file. Instead of simply adding a breakpoint at the function (for example, add a breakpoint for class Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.from_nxy should break at
omc_Modelica_Mechanics_MultiBody_Frames_TransformationMatrices_from__nxy
)
Is this one comment with two different numbers? BTW, function breakpoints are not supported. If you browse a class you must specify a line number.
- C frames are not shown, even when stopping in a C frame (like an external function causing a segmentation fault)
There are options in OptionsDialog to display C frames. Now I have the set these options to true by default.
- Launching the debugger does not seem to run with the same command-line arguments as when simulating normally
What is the difference? I have to check it.
- Clicking the pause button does not suspend the executable
Pause is not supported yet.
follow-up: 7 comment:6 by , 10 years ago
Replying to adeas31:
- It is not possible to start the process paused (to add breakpoints easily)
What do you mean?
If you start a simulation and choose to open the debugger, it runs the simulation without stopping. This means you have to set breakpoints, then re-compile, and run...
Is this one comment with two different numbers? BTW, function breakpoints are not supported. If you browse a class you must specify a line number.
Which is stupid and pointless. Of course we want to be able to break at a specific function. Should I really need to open a file editor to try to find out the line that a function begins at? In gdb I always use function breakpoints because they are much simpler to use.
- C frames are not shown, even when stopping in a C frame (like an external function causing a segmentation fault)
There are options in OptionsDialog to display C frames. Now I have the set these options to true by default.
Sure, they are shown then. But the variables inside them are not.
- Launching the debugger does not seem to run with the same command-line arguments as when simulating normally
What is the difference? I have to check it.
I do not get any LOG_STATS output, etc. This means you are debugging a different execution than the one you intended to. (Some flags cause seg.faults)
- Clicking the pause button does not suspend the executable
Pause is not supported yet.
:(
follow-up: 8 comment:7 by , 10 years ago
Replying to sjoelund.se:
Replying to adeas31:
- It is not possible to start the process paused (to add breakpoints easily)
What do you mean?
If you start a simulation and choose to open the debugger, it runs the simulation without stopping. This means you have to set breakpoints, then re-compile, and run...
If you start a simulation without checking "launch debugger" simulation option then it is a normal simulation without gdb so adding breakpoints is not possible. You could try to attach the debugger but it will be useless since there is no -g used for compilation. But if "launch debugger" is checked then the simulation is started with gdb and you can set breakpoints etc.
Is this one comment with two different numbers? BTW, function breakpoints are not supported. If you browse a class you must specify a line number.
Which is stupid and pointless. Of course we want to be able to break at a specific function. Should I really need to open a file editor to try to find out the line that a function begins at? In gdb I always use function breakpoints because they are much simpler to use.
The function names are not same. In Modelica a function name is xyz but in simulation runtime it is omc_xyz. Anyways, I am currently adding more features in breakpoints e.g conditional breakpoints etc. so I will think about function breakpoints also.
- C frames are not shown, even when stopping in a C frame (like an external function causing a segmentation fault)
There are options in OptionsDialog to display C frames. Now I have the set these options to true by default.
Sure, they are shown then. But the variables inside them are not.
It is possible to show variables but I need a lot of time to support C in debugger.
- Launching the debugger does not seem to run with the same command-line arguments as when simulating normally
What is the difference? I have to check it.
I do not get any LOG_STATS output, etc. This means you are debugging a different execution than the one you intended to. (Some flags cause seg.faults)
True. You need to manually specify the arguments OR always use the simulation dialog. I can add a checkbox in simulation dialog like "Create debugger confiuration". If it is checked then create a new debugger configuration with all the arguments so that we can reuse it.
- Clicking the pause button does not suspend the executable
Pause is not supported yet.
:(
It will be available soon.
comment:8 by , 10 years ago
Replying to adeas31:
If you start a simulation without checking "launch debugger" simulation option then it is a normal simulation without gdb so adding breakpoints is not possible. You could try to attach the debugger but it will be useless since there is no -g used for compilation. But if "launch debugger" is checked then the simulation is started with gdb and you can set breakpoints etc.
No, I can not. Because if I check "launch debugger", the simulation runs so fast I can't do anything before it finishes.
The function names are not same. In Modelica a function name is xyz but in simulation runtime it is omc_xyz. Anyways, I am currently adding more features in breakpoints e.g conditional breakpoints etc. so I will think about function breakpoints also.
Yes, but you can just transform the class name into its function name. Or use an API call to ask what the name would be.
True. You need to manually specify the arguments OR always use the simulation dialog. I can add a checkbox in simulation dialog like "Create debugger confiuration". If it is checked then create a new debugger configuration with all the arguments so that we can reuse it.
No. Using the simulation dialog I get no output.
comment:9 by , 10 years ago
Milestone: | 1.9.1 → 1.9.2 |
---|
This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).
comment:10 by , 10 years ago
Milestone: | 1.9.2 → 1.9.3 |
---|
Milestone changed to 1.9.3 since 1.9.2 was released.
comment:15 by , 8 years ago
Milestone: | 1.11.0 → 1.12.0 |
---|
Milestone changed to 1.12.0 since 1.11.0 was released.
comment:16 by , 7 years ago
Milestone: | 1.12.0 → Future |
---|
I have merged the debugger with the trunk and few of the features listed are done now.