Giter Site home page Giter Site logo

epasveer / seer Goto Github PK

View Code? Open in Web Editor NEW
2.0K 18.0 67.0 17.19 MB

Seer - a gui frontend to gdb

License: GNU General Public License v3.0

CMake 0.53% C++ 92.49% C 2.70% Makefile 1.28% Assembly 0.07% Go 0.07% Ada 0.26% Rust 0.03% Python 2.34% Cuda 0.11% GDB 0.12%
gdb-frontend gdb-mi gdb debugger debugging debug qt5 qt debugger-gdb debuggers

seer's People

Contributors

alfishe avatar epasveer avatar ernstki avatar hrw avatar karstensb avatar lilithium-hydride avatar malikmlitat avatar mgrojo avatar nolange avatar notspiff avatar plazmama avatar quoteme avatar skyluker4 avatar trumank avatar uyar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

seer's Issues

Double-click variable to add to Logger.

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 "*&"

Possible change to "run to line".

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 :

  • Ensure target program is loaded.
  • Set a temporary breakpoint at the "run to line" point.
  • Start the target program and it would eventually stop at the breakpoint (and other breakpoints that may have been set).

From the user's perspective, the "run to line" would work regardless if the target program is running or not.

Build issues (Ubuntu 21.04)

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

Make ^F and ^O global.

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.

The "file" name may not always be the short name of the "fullname".

"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.

Not all apps deal with threads.

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 - option to direct output to "Gdb Output" tab.

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.

Seer/Gdb "output" enable button.

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.

Config for keys.

Add config page for key bindings.

  • Start/Run
  • Continue
  • Step/Next/Finish
  • Interrupt
  • Search in editor. (^F)
  • Open alternate source directory (^O)

Seer Console mode.

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.

Doesn't catch if the gdb process exits unexpectedly.

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.

ArrayVisualizer - Not complete yet.

At the moment, ArrayVisualizer is a copy of the MemoryVisualizer. I need to finish it off.

Features will be, display array as:

  • a table.
  • a chart

Along with options to save or print.

Detach/Re-attach some tab widgets.

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.

Dprintf error and calling a function that throw/terminate.

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())"

Q_ASSERT

Use Q_ASSERT in the code instead of 'assert'.

Misc issues.

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

Arch AUR package

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.

Load saved breakpoints from the command line.

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.

File->Arguments... does not work anymore.

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.

Need to save window size state.

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.

Add a configurable line limit to console and log widgets.

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.

Cannot build on Manjarao Cinnamon x64

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
.

PrintPoint fail with syntax error.

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.

Standard icons.

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.

Mismatch line numbers.

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.

Detach from executable before exiting when using "attach" mode.

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.

Assumption that gdb is /usb/bin/gdb

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.

Interfacing with avr-gdb

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.

  1. 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.

  2. 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.

  1. The debugger does not show any file under the list of source or library files. I could manually select the source file, though.

  2. 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

Add reload of Printpoints.

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 source files

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.

Need to pass "--frame N" to some gdb/mi commands.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.