epasveer / seer Goto Github PK
View Code? Open in Web Editor NEWSeer - a gui frontend to gdb
License: GNU General Public License v3.0
Seer - a gui frontend to gdb
License: GNU General Public License v3.0
In the SeerConfig dialog, have a setting for the font to use for the Seer Console. Some installtions may need this.
When adding new text to the bottom of the output tabs for Gdb and Seer, the scrollbars do not keep the view at the bottom. Instead, the top of the view is shown (while text is appended to the bottom).
When double-clocking a variable to add to the Seer Variable Logger, allow meta keys to prepend variable access. Otherwise, nothing is prepended.
- SHIFT = prepends "*"
- CTRL = prepends "&"
- SHIFT+CTRL = prepends "*&"
Currently, "run to line" requires the target program to have already been started by 'run' or 'start'. However, Seer knows if the target program is running or not. If it's not running, I suppose it can intercept the "run to line" action and :
From the user's perspective, the "run to line" would work regardless if the target program is running or not.
Hi, had a few problems building on this platform, with a number of depreciated declarations;
Builds/seer/src/SeerDebugDialog.cpp: In constructor ‘SeerDebugDialog::SeerDebugDialog(QWidget*)’:
Builds/seer/src/SeerDebugDialog.cpp:13:84: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations]
13 | amPidLineEdit->setMaximumWidth(fontMetrics().width("888888888888888"));
| ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qwidget.h:50,
from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qdialog.h:44,
from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QDialog:1,
from /home/dmarples/Builds/seer/src/SeerDebugDialog.h:3,
from /home/dmarples/Builds/seer/src/SeerDebugDialog.cpp:1:
/usr/include/x86_64-linux-gnu/qt5/QtGui/qfontmetrics.h:106:9: note: declared here
106 | int width(const QString &, int len = -1) const;
| ^~~~~
Builds/seer/src/SeerDebugDialog.cpp:14:90: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations]
14 | tPortLineEdit->setMaximumWidth(fontMetrics().width("XXXXXXXXXXXXXXX"));
| ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qwidget.h:50,
from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qdialog.h:44,
from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QDialog:1,
from /home/dmarples/Builds/seer/src/SeerDebugDialog.h:3,
from /home/dmarples/Builds/seer/src/SeerDebugDialog.cpp:1:
/usr/include/x86_64-linux-gnu/qt5/QtGui/qfontmetrics.h:106:9: note: declared here
106 | int width(const QString &, int len = -1) const;
| ^~~~~
...etc
I'm afraid this escalates to errors further on;
[ 39%] Building CXX object CMakeFiles/seer.dir/SeerEditorWidgetSourceArea.cpp.o
/home/dmarples/Builds/seer/src/SeerEditorWidgetSourceArea.cpp: In member function ‘int SeerEditorWidgetSourceArea::lineNumberAreaWidth()’:
/home/dmarples/Builds/seer/src/SeerEditorWidgetSourceArea.cpp:120:57: warning: ‘int QFontMetrics::width(QChar) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations]
120 | int space = 3 + fontMetrics().width(QLatin1Char('9')) * digits;
| ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qwidget.h:50,
from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QWidget:1,
from /home/dmarples/Builds/seer/src/SeerEditorWidget.h:3,
from /home/dmarples/Builds/seer/src/SeerEditorWidgetSourceArea.cpp:1:
/usr/include/x86_64-linux-gnu/qt5/QtGui/qfontmetrics.h:110:9: note: declared here
110 | int width(QChar) const;
| ^~~~~
/home/dmarples/Builds/seer/src/SeerEditorWidgetSourceArea.cpp: In member function ‘void SeerEditorWidgetSourceArea::breakPointAreaPaintEvent(QPaintEvent*)’:
/home/dmarples/Builds/seer/src/SeerEditorWidgetSourceArea.cpp:250:34: error: aggregate ‘QPainterPath path’ has incomplete type and cannot be defined
250 | QPainterPath path;
| ^~~~
/home/dmarples/Builds/seer/src/SeerEditorWidgetSourceArea.cpp:264:34: error: aggregate ‘QPainterPath path’ has incomplete type and cannot be defined
264 | QPainterPath path;
| ^~~~
/home/dmarples/Builds/seer/src/SeerEditorWidgetSourceArea.cpp: In member function ‘void SeerEditorWidgetSourceArea::miniMapAreaPaintEvent(QPaintEvent*)’:
/home/dmarples/Builds/seer/src/SeerEditorWidgetSourceArea.cpp:316:42: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations]
316 | if (fm.width(block.text()) > pixmapWidth) {
| ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qwidget.h:50,
from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QWidget:1,
from /home/dmarples/Builds/seer/src/SeerEditorWidget.h:3,
from /home/dmarples/Builds/seer/src/SeerEditorWidgetSourceArea.cpp:1:
/usr/include/x86_64-linux-gnu/qt5/QtGui/qfontmetrics.h:106:9: note: declared here
106 | int width(const QString &, int len = -1) const;
| ^~~~~
/home/dmarples/Builds/seer/src/SeerEditorWidgetSourceArea.cpp:317:56: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations]
317 | pixmapWidth = fm.width(block.text());
| ^
In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qwidget.h:50,
from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QWidget:1,
from /home/dmarples/Builds/seer/src/SeerEditorWidget.h:3,
from /home/dmarples/Builds/seer/src/SeerEditorWidgetSourceArea.cpp:1:
/usr/include/x86_64-linux-gnu/qt5/QtGui/qfontmetrics.h:106:9: note: declared here
106 | int width(const QString &, int len = -1) const;
| ^~~~~
make[3]: *** [CMakeFiles/seer.dir/build.make:277: CMakeFiles/seer.dir/SeerEditorWidgetSourceArea.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:96: CMakeFiles/seer.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:103: CMakeFiles/seer.dir/rule] Error 2
make: *** [Makefile:137: seer] Error 2
I suspect this is a versioning problem or similar. cmake passed ok.
Regards
DAVE
Seer will remember Breakpoints if the Restart button is pressed.
Look at using these commands:
save breakpoints [filename]
source [-s] [-v] filename
Currently ^F and ^O are limited to the source editor. So the source editor window needs focus from them to take effect. Make ^F and ^O global so that it doesn't matter which widget has focus.
Dave Marples [email protected] wrote:
How are you connecting to the target? I suspect it's with 'target
remote xxx:yyy'. It should be possible to use 'target extended-remote
xxx:yyy' too because that allows the use of 'Run' etc.
"fullname" is the full name including path for the source file.
"file" is meant to be just the filename, excluding the path.
Depending on how the program is compile/linked, "file" may include part of the path. Sometimes start with "/" (absolute) or starting in the middle of the path (relative).
Look at making "file" to always be just the name by chopping off any preceding path. Do this when the list of source files is read from the executable.
For better code, the -Werror flag should be added to catch possible coding errors.
Dave Marples [email protected] wrote:
Thread Info may not always be useful in the embedded environment. It
can be as some of the debug stubs (e.g. openocd) present the target OS
threads via gdb, but it should be toggle-able. In general, do you intend
to make the windows configurable?
Printpoints, aka 'dprintf', is currently written to the Seer Console. This is fine for most apps. In this mode, 'dprintf' uses the target application's 'printf' function. So it means, 'dprintf' only works if the app has 'printf' linked in. So this might not work for embedded apps.
Printpoints will also work if the output is directed gdb's console. This is shown in the "Gdb Output" tab.
Seer needs to support both methods. With a configuration setting.
For each tab in the CodeEditorManager widget, show the file's short and fullname as a tool tip.
explorer.cpp : /home/erniep/Development/Peak/src/apps/Explorer/explorer.cpp
The "enable" setting for these two views should be saved in the app settings so they get remembered for the next time Seer is used.
When using corefile mode (seer --core corefile application), commands like 'next', 'step', etc. are meaningless. They should be disabled.
Add config page for key bindings.
Some gdb installations have old versions of gdb that may not have some required gdbmi calls. gdbmi has a method to query what's available for calls. Perhaps have a graceful way of detecting the error in the subject line. This call is for listing what shared libraries an exectuable uses.
If 'run' or 'start' is selected, the current list of breakpoints are cleared. This should only happen if a new executable is loaded.
Dave Marples [email protected] wrote:
The 'Seer Console', which is presumably a reflection of the target
stdio, isn't too useful in an embedded environment by default. It can
be useful if you're running semihosted, but not by default.
Had an interesting case of the gdb process encountering a 'sigsegv' when loading a program's image. Even running gdb from the command encountered the same problem.
The QProcess object should be able to notify (via a signal) the SeerGdbWidget object of this early/bad/unexpected exit of the gdb process that it launched. And bring up a dialog, with the exit status of gdb.
At the moment, ArrayVisualizer is a copy of the MemoryVisualizer. I need to finish it off.
Features will be, display array as:
Along with options to save or print.
Dave Marples [email protected] wrote:
The application doesn't seem to produce a set of registers (I'm
suspecting it might be expecting x86 ones?). They appear very briefly.
The tab widgets (breakpoints, watchpoints, catchpoints, printpoints, gdb output, seer output) will likely benefit if they can be detached. This will create a detached window that can be resized to the user's liking. Then later reattached to the Seer tab widget.
Got this error when using a dprinf call on the Explorer "data.size()" function.
4 0x00007ffff720165f in ModuleBase::executeGroup (this=0x646df0, data=...) at ModuleBase.cpp:582
582 s = doGroup(data);
The program being debugged entered a std::terminate call, most likely
caused by an unhandled C++ exception. GDB blocked this call in order
to prevent the program from being terminated, and has restored the
context to its original state before the call.
To change this behaviour use "set unwind-on-terminating-exception off".
Evaluation of the expression containing the function (DataAccessor::size() const)
will be abandoned.
dprintf statement:
"call (void) printf (\"Working on a group of %d traces.\\n\",data.size())"
Use Q_ASSERT in the code instead of 'assert'.
Here are some issues raised by Dave Marples.
On Monday, September 13, 2021, 05:25:20 PM CDT, Dave Marples [email protected] wrote:
Ernie,
Figured I'd send you this lot directly rather than via the bug reporting
system.
My interest in seer is for embedded use, so I need to be able to
configure the gdb that is used. I edited the source to run my
arm-none-eabi-gdb and it did at least get started, but wasn't too happy.
Some comments;
It would be really nice to have colourised source code
The 'Seer Console', which is presumably a reflection of the target
stdio, isn't too useful in an embedded environment by default. It can
be useful if you're running semihosted, but not by default.
The application doesn't seem to produce a set of registers (I'm
suspecting it might be expecting x86 ones?). They appear very briefly.
Thread Info may not always be useful in the embedded environment. It
can be as some of the debug stubs (e.g. openocd) present the target OS
threads via gdb, but it should be toggle-able. In general, do you intend
to make the windows configurable?
I think folks have got used to Icons for Run/Start/Next/Step etc...it
would be nice if we could have those.
How are you connecting to the target? I suspect it's with 'target
remote xxx:yyy'. It should be possible to use 'target extended-remote
xxx:yyy' too because that allows the use of 'Run' etc.
Hope this lot is some use.
Regards
DAVE
Add 'match case' for searching in source file in the search bar. As well, add the number of matches. eg: (1/25) Where 1 is the current match and 25 is the total number of matches.
Hi, I set up a (git) package
on the Arch AUR. Sadly seer-git
was already taken, hence I named it seer-gdb-git
. Let me know if you want the ownership.
Example:
seer --start myprogram 'this is meant to be one argument'
Actually has 7 arguments passed to Seer.
Add a method to load a previously saved breakpoint file from the command line.
It will source this file just prior to running/starting the executable.
% seer --breakpoints myprog.brk --start myprog arg1 arg2
% seer -b myprog.brk --start myprog arg1 arg2
As well as to the Debug dialog.
Duplicate entries in the SourceBrowsersWidget.
It is meant to set the target program's arguments for the next 'run' or 'start'.
It is now broken (worked before). It ignores the new arguments and still uses the original arguments.
Dave Marples [email protected] wrote:
It would be really nice to have colourised source code
Save the window state when resizing the main window, console window, and memory visualizer window so the windows are resized when seer is restarted. Same goes for the widgets that are managed by QSplitters.
In some cases, the output from a program can produce large amounts of messages going to the console or log widgets.
Add a configurable value to cap the number of lines in them.
Console
Seer Log
Gdb Log
One value for all of them should work. A '0' means no limit. 1000 means to remember 1000 lines. 1000 can be the default.
Old lines are forgotten. While new lines are shown at the bottom of the log.
Dave Marples [email protected] wrote:
I think folks have got used to Icons for Run/Start/Next/Step etc...it
would be nice if we could have those.
Sometimes (rarely), double-clicking on a variable in the editor window will do a quick logger add of "variable" instead of just "variable". Not sure where/how it's prepending the '' character.
The package manager has support for installing directly via the AUR so I tried both variants that showed up in the search, one fails & aborts, the other causes a total system crash. I'm sure you have virtual box or something so just give it a try there to see what I mean, I attached the log for the one that doesn't crash the system, can't do anything about the other though.
seer_build_log.txt
.
Setting a PrintPoint fails.
Loop %d of %d\n
K L1
Error Message:
breakpoint-modified,bkpt={number="2",type="dprintf",disp="keep",enabled="y",addr="0x00007ffff5c3f8c4",func="cfftx",file="sssMathlib.f",fullname="/home/erniep/Development/Peak/src/Core/Math/sssMathlib.f",line="1073",thread-groups=["i1"],times="1",script={"call (void) printf ("Loop %d of %d\
",K,L1)"},original-location="-source /home/erniep/Development/Peak/src/Core/Math/sssMathlib.f -line 1073"}
Invalid character '"' in expression.
A lot of the basic icons I was relying on from the "standard" icon theme available on the OS are not there.
It's best if I include my own.
These are for: document-add, document-save, etc.
Sometimes seer will position the current line on the wrong line.
This happens if the source files have blank lines at the top of the source file. This causes a mismatching of the current line. Blank lines later on do no matter.
This test program illustrates the problem. Note the blank lines in front of '#include'.
% cat fail.c
#include <stdio.h>
int main()
{
printf("hi ");
printf("there ");
printf("Ernie!\n");
return 0;
}
Compile/link the program with:
% gcc -g fail.c -o fail
Debug it with:
% seer -s fail
And you'll see seer has removed the preceeding blank lines, thus causing the mismatching.
Thanks to @chucktilbury for figuring this out.
When closing Seer when it was debugging a program via "attach", need to detach from the pid first before exiting. Sometimes this error is encountered.
Trace/breakpoint trap (core dumped)
Here is the gdbmi command.
The -target-detach Command
Synopsis
-target-detach [ pid | gid ]
Detach from the remote target which normally resumes its execution. If either pid or gid is specified, detaches from either the specified process, or specified thread group. There’s no output.
On very old hardware, it may take a few seconds to load an executable into gdb. While this is happening, add a "spin" indicator. Otherwise, it looks like Seer is doing nothing.
As far as I checked, there is no license in the code which means the software cannot be legally used and redistributed at all...?
Program seems to assume that gdb is /usr/bin/gdb (SeerGdbWidget.cpp:996). This doesn't make much sense in the general case, and in my specific case where I want to use an embedded gdb (arm-none-eabi-gdb).
In addition, I cannot run startup scripts (.gdbinit or equivalent), unless I missed something.
Hi,
I tried out seer and it worked quite well. Thanks a lot for your work! There are a few hickups when it comes to embedded debugging for AVR MCUs, though.
You cannot specify an alternative gdb executable as already pointed out in issue #3. I changed the source code in order to try it out. Would be great to have a menu for that.
When specifying the executable to be debugged, I specified the ELF file and for the Gdbserver I gave the serial device. With that seer/avr-gdb could make the connection to thze hardware debugger, but I got the following warning:
thread-group-added,id="i1"
GNU gdb (GDB) 8.1.0.20180409-git
...
Warnung: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
thread-created,id="1",group-id="i1"
0x00000000 in ?? ()
So, I issued the file
and the load
command:
file tiny85blink.ino.elf
A program is being debugged already.
Are you sure you want to change the file?
(y or n) [answered Y; input not from terminal]
Load new symbol table from "tiny85blink.ino.elf"? (y or n) [answered Y; input not from terminal]
Reading symbols from tiny85blink.ino.elf...
load
Loading section .text, size 0x1e8 lma 0x0
Start address 0x0, load size 488
Transfer rate: 2 KB/sec, 162 bytes/write.
After that I could set breakpoints, start and stop the program etc.
The debugger does not show any file under the list of source or library files. I could manually select the source file, though.
When the debugger ended up in one of the Arduino 'core' files, I could not set a breakpoint (probably something caused by the two control characters in front of the file name):
Keine Zeile 12 in Datei \302\273/home/parallels/.arduino15/packages/ATTinyCore/hardware/avr/1.5.2/cores/tiny/main.cpp\302\253.
If you want to debug things having to do with avr-gdb, I recommend to download the packages gdb-avr (the avr debugger), simavr (an AVR simulator), and, of course, the avr toolchain gcc-avr.
Best regards,
Bernhard
It's possible to have a lot of files opened in the Editor Manager. Closing unwanted files can be cumbersome when using the tabs.
Add a dialog that will list all opened files ("file", "filename", details) and select which ones to close.
Add a feature to reload set Printpoints between sessions (when the Restart button is used).
Perhaps "save breakpoints" will work. See the other task. (#27)
Empty files are opened if the source files do not exist at the initial location. A common solution is to let the user select the missing source file and derive the base source location and possibly handle multiple locations.
When adding a breakpoint/printpoint, the "--frame N" argument needs to be provided if the user is trying to set a point with just the line number.
The gdb doc says:
-stack-select-frame framenum
This command in deprecated in favor of passing the ‘--frame’ option to every command.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.