Git Product home page Git Product logo

prodbg's Introduction

ProDBG is a new debugger under development that will support a variety of targets and operating systems. Currently it's in very early development and primary focusing on Linux as primary target.

Build status

Build status

Status

As the rewrite of ProDBG (to using Qt in C++) is currently under way no debugging is working currently as everything is being brought up again. At this time C++ will be used for the UI but backends will be able to use different languages (such as Rust) as a C API is provided for this.

Cloning the repository

The ProDBG repository contains submodules. Clone it with git clone --recursive. If you forgot to clone it recursively the first time, from within the cloned repository run git submodule update --init --recursive.

How to compile and build

Latest stable version of Rust (1.36+) needs to be present on the system. We recommend using rustup to install and manage your Rust toolchain(s). There are also other ways to install rustup. If you already have rustup installed but aren't on the latest stable Rust, you can simply run rustup update.

Prequisites

ProDBG requires Qt as it's used for the UI. Go and install the 5.7 version and pick the 64-bit version for your system. You also need to set three env variables: QT5_LIB, QT5_BIN, QT5_INC in order to build the code. See more details for each platform.

macOS

Prequisites

Building the code on macOS requires that Clang is installed on your system. The easiest way to do this is to get Xcode and install the commandline tools.

Rustup

Run: rustup install stable-x86_64-apple-darwin or rustup override add stable-x86_64-apple-darwin

Build

Run: scripts/mac_build_debug.sh

Output

The main execeutable is located at: t2-output/macosx-clang-debug-default/ProDBG.app/Content/MacOS/prodbg

Windows

Prequisites

On Windows Visual Studio 2017 or later is required (2012 or earlier will not work as parts of the code uses C99)

Env variables

Something similar to this

QT5_LIB=C:\Qt\5.12.4\msvc2017_64\lib
QT5_BIN=C:\Qt\5.12.4\msvc2017_64\bin
QT5_INC=C:\Qt\5.12.4\msvc2017_64\include

Rustup

rustup install stable-x86_64-pc-windows-msvc or rustup override add stable-x86_64-pc-windows-msvc

Build

Run: scripts\vcvarsx86_amd64.bat and then scripts\win64_build_debug.cmd

Run

Run: t2-output\win64-msvc-debug-default\prodbg.exe

Linux

Prequisites

Building the code on Linux will require some prerequisites to be installed. Which prerequisites depends on the distribution being used.

For Ubuntu you can use the following:

sudo apt-get update
sudo apt-get install -y libx11-dev libgl1-mesa-dev libgtk-3-dev pkg-config qt515base

ProDBG uses Tundra to build the project the project. Binaries are supplied on macOS and Windows but needs to be built on Linux:

  • git clone https://github.com/deplinenoise/tundra.git
  • cd tundra
  • CXX=g++ make
  • sudo make install

Env variables

These highly depends on how your system is setup. Here are two examples

export QT5_BIN=/usr/bin
export QT5_INC=/usr/include/x86_64-linux-gnu/qt5/
export QT5_LIB=/usr/lib/x86_64-linux-gnu
export QT5_BIN=/opt/qt512/bin
export QT5_INC=/opt/qt512/include
export QT5_LIB=/opt/qt512/lib

Rustup

Run: rustup install stable-x86_64-unknown-linux-gnu or rustup override add stable-x86_64-unknown-linux-gnu

Build

Run: tundra2 linux-gcc-debug

Run

The main executable is located at: t2-output/linux-gcc-debug-default/prodbg

prodbg's People

Contributors

ashemedai avatar bitshifter avatar derwiath avatar emoon avatar gitter-badger avatar gw3583 avatar gwihlidal avatar hugin84 avatar kayru avatar kondrak avatar nmlgc avatar slnpacifist avatar stalehard avatar thewatchmen avatar v3n avatar xilec avatar zerhacken 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  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

prodbg's Issues

Workspace 0.1

Feature level 0.1:

  • A basic Workspace is needed where you can:
  • Add source links (in a tree view)
  • Store settings for a project (breakpoints, layouts, executable, parameters, etc)

Record code flow

Mark a function or some # lines of code and record the execution flow history for some given amount of hits or time period.

Native debugging 0.1

Feature level for 0.1:

  • Set breakpoints at given source/line location (error handling of this doesn't need to be super good at this point if source/line doesn't match current executable)
  • Stepping: Single step, step in, step out, run until
  • Stop current running program
  • Continue
  • Abort
  • Load executable with set working directory and command line

Step out of loop

Feature so when you are inside a loop you can setup out from it and the continue the execution after the loop

Visualize memory

Using either script or some other nice way (like struct descriptor also should work)

Building on OSX 10.9

Just got around to try to build the project, and got stuck on the qt version(s).

I downloaded the Qt 5.2.0 version and set the QT5 env var to that folder (Qt/5.2.0/clang_64), which makes it find the bin folder, but unfortunately not the QtWidgets include. This is easy to understand since apparently, the installer for Qt5.2 stopped shipping all the includes(!?). The Qt5.1.0 installer contains all include folders, but then Qt won't build on OSX 10.9 (it seems to only support 10.8).

So I tried building the source from Qt/5.2.0/Src/qtbase, but running make install gave me the same missing include folders. I've reached the highest level of success by setting the QT5 to the Src/qtbase directory since the bin and includes are there. However, then I get a build error:

qmetatype.h:2040:97: error: declaration requires an exit-time destructor [-Werror,-Wexit-time-destructors]
QtMetaTypePrivate::QPairVariantInterfaceConvertFunctor > f(o);

Any suggestions on how to "build from scratch" ? I propose adding these build notes to the readme for future readers.

Regards,
Mathias

Debug Output View 0.1

Basic TTY view that listens to stdout from the process being debugged. Very basic similar to VS

output_2

Bookmarks in memory view

Bookmarks in memory view. Both on an address and on selection of bytes. (Something like HexFiend on OSX)

DisassemblyView 0.1

This to support for 0.1:

  • Show accurate disassembly (from native and remote)
  • Switchable in the source view with space
  • Register highlighting
  • No mix source/disassembly for 0.1

BreakpointView 0.1

Basic list of all the breakpoints with possibility to enable/disable a breakpoint (checkbox)
Adding a breakpoint in the source view should show up in this list and vice versa.

Supported types for 0.1

  • File/Line
  • Address
  • Data breakpoint

File/Line

breakpoints_0

Address

breakpoints_1

Pressing new breakpoint button should give a request with something like this

breakpoints_2

Data breakpoint in list

breakpoints_3

LocalsView 0.1

Feature level for 0.1:

  • Show the current locals in the function being debugged
  • Support edit simple types (ints, floats, etc)

locals

WatchView 0.1

watch_default

Feature Level for 0.1:

  • Very Similar to the locals view but you should be able to watch variables (similar to watches in ProDG/Visual Studio)

watch_1

  • Add variables to watch should be possible and look something like this

watch_2

Unfolding of variables with changed color if values has changed

Step Into Function

Sometimes you see code like this:

MyFunc(a->Width(), a->Height(), a->Bla(), b->Foo());

Using the usual "Step Into" will take you to all kinds of functions you might not care about and is super tedious. A new "Step Into Function" should step into the last function called on the line: MyFunc..

Snapshot + replay

With scrub-able timeline. Would be very awesome but almost impossible to implement (at least for native) some emulated targets may be possible to handle this

ThreadView 0.1

Features for 0.1:

Should be possible to switch thread in the thread view. For 0.1 I don't think we need to support freezing and such of threads. Switch thread should be reflected correctly in the callstack view also.

threads

CallstackView 0.1

Feature level should be similar to ProDG/Visual Studio

callstack_0

Selecting another entry in the in the callstack should send an event that all other views can listen to (locals needs to switch variables, registers needs to be updated etc)

callstack_1

Callstack should support symbols just as well as addresses.

Remote API 0.1

Feature level for RemoteAPI:

  • The remote API is a simple API that allows debugging of "Remote" Targets over TCP/IP using a simple message sending system. For one example there is a examples/Fake6502 included which shows how to debug an emulated 6502 CPU
  • Stepping : step in, out, etc (worth to notice that its up to the remote api to implement them correctly but ProDBG should be able to send the data)
  • Request memory, disassembly, exception location

Alternate colors in mem view based on stride

Alternate line colours for memory views as default, but with the ability to instead specify a stride for colouring.

Hotkeys for going to next 'start of block' would be nice.

Reload support

Debugger should support (but not enforce) that parts of code can be (re)loaded without restarting the debugging session.

SourceCodeView 0.1

Features for 0.1:

  • Have basic version of Source Code View working with Scintilla. A fair amount of work has been done here already but needs some more fixes before it can be considered 0.
  • Goto line
  • Search text
  • Hover var and expand (very similar to locals view but on top of the source view similar to VS)

image

Better thread control

Pause thread(s), step specific thread(s), and step "across" threads on context switch (as if single core).

Support for remote debugging

Ability to install a lightweight service\listener on a target machine, and provide most - if not all - debugging features from a remote machine running the ProDBG application.

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.