Giter VIP home page Giter VIP logo

tug's Introduction

Tug

GDB frontend made with Dear ImGui

image

Tugboat captain is the GDB archer fish mascot https://sourceware.org/gdb/mascot/
Jamie Guinan's original archer fish logo and the vector versions by Andreas Arnez are licensed under CC BY-SA 3.0 US. https://creativecommons.org/licenses/by-sa/3.0/us/

Untitled

Building the Project

  1. Install gcc, gdb, and make

  2. For X11 based systems, install additional packages
    Debian, Ubuntu, Linux Mint: sudo apt-get install xorg-dev
    Fedora, RHEL: sudo dnf install libXcursor-devel libXi-devel libXinerama-devel libXrandr-devel
    FreeBSD: pkg install xorgproto

  3. Run command "make DEBUG=0", output executable is ./build_release/tug

Debugging an Executable

NOTE: Tug defaults to the gdb filename returned by the command "which gdb"

  1. run program from command line
    tug --exe [program to debug filename] --gdb [gdb filename]

OR

  1. run tug
  2. click "Debug" menu button
  3. fill in gdb filename and debug filename, args are optional
  4. click "Start" button

Source Window

  • CTRL-F: open text search mode, N = next match, SHIFT-N = previous match, ESC to exit
  • CTRL-G: open goto line window, ENTER to jump to input line, ESC to exit
  • hover over any word to query its value, right click it to create a new watch within the control window
  • add/remove breakpoint by clicking the empty column to the left of the line number

Control Window

program execution buttons

  • "---" = jump to next executed line inside source window
  • "|>" = start/continue program
  • "||" = pause program
  • "-->" = step into
  • "/\>" = step over
  • "</\" = step out

GDB Console Command Line

  • repeat last command on hitting enter on an empty line (GDB emulation)
  • cycle command history by pressing up/down arrow while clicked on the box
  • hit tab while typing to see all the autocompletions, hit tab/shift tab to cycle through them

Resources

GDB Machine Interpreter:
https://sourceware.org/gdb/download/onlinedocs/gdb#GDB_002fMI

GLFW:
https://www.glfw.org/download.html
https://www.glfw.org/docs/latest/compile.html

tug's People

Contributors

kyle-sylvestre 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

tug's Issues

Great work - question

Lovely to see another imgui example and a native GDB GUI. Thanks!

Question: How to build it?

What toolchain do you use to build Tug? Looks like g++ on Windows. Is this correct?

Are there any additional dependencies?

Some more detail. Getting different results running in a VS code terminal (1) and Msys64 (2).

Cannot see how this would build on any Posix system due to different casing in #include <GLFW/glfw3.h> and path/to/Tug/third-party/glfw

where g++
R:\apps\msys64\usr\bin\g++.exe
$ g++ --version
g++ (GCC) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
make -v
GNU Make 4.3
Built for x86_64-pc-msys
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

(1) Probably fails due to make inability to expand SRC := $(shell find . -name "*.cpp") correctly.

R:\src\test\Tug>make
File not found - *.cpp
g++ -o tug.elf  -I./third-party -I./src -std=c++11 -g -O0 -Wall -Wformat -Wextra -Wshadow -pedantic -fsanitize=undefined,address  -L./third-party/glfw -lglfw -lGL -lpthread
/usr/lib/gcc/x86_64-pc-msys/11.2.0/../../../../x86_64-pc-msys/bin/ld: cannot find -lglfw
/usr/lib/gcc/x86_64-pc-msys/11.2.0/../../../../x86_64-pc-msys/bin/ld: cannot find -lGL
/usr/lib/gcc/x86_64-pc-msys/11.2.0/../../../../x86_64-pc-msys/bin/ld: cannot find -lasan
/usr/lib/gcc/x86_64-pc-msys/11.2.0/../../../../x86_64-pc-msys/bin/ld: cannot find -lubsan
collect2: error: ld returned 1 exit status
make: *** [Makefile:12: tug.elf] Error 1

(2)

 MSYS /r/src/test/Tug
$ make > log 2>&1
 MSYS /r/src/test/Tug
$ head log
g++ -I./third-party -I./src -std=c++11 -g -O0 -Wall -Wformat -Wextra -Wshadow -pedantic -fsanitize=undefined,address  -L./third-party/glfw -lglfw -lGL -lpthread -c -o src/gdb.o src/gdb.cpp
In file included from src/gdb.cpp:24:
src/common.h: In function ‘String GetAtomString(Span, const Record&)’:
src/common.h:77:92: error: expected unqualified-id before ‘=’ token
   77 |     char __gdb_buf[128]; tsnprintf(__gdb_buf, "gdb --pid %d", (int)getpid()); int __unused = system(__gdb_buf); __unused = __unused; exit(1);\
      |                                                                                            ^
src/common.h:448:5: note: in expansion of macro ‘Assert’
  448 |     Assert(s.index + s.length <= rec.buf.size());
      |     ^~~~~~
src/common.h:77:122: error: expected primary-expression before ‘=’ token

MTIA.

please provide a release version

Hello, and thanks for your effort.

I want to see your package in void repo. but VoidLinux has a policy that every package should have a release version to be able to add.

Can you please provide a release version?

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.