GithubHelp home page GithubHelp logo

aidan63 / hxcppdbg Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 2.0 1.03 MB

experimental hxcpp debugger using the windows debugger engine or lldb

Haxe 29.21% C++ 70.25% TypeScript 0.54%
cpp debugger debugging haxe

hxcppdbg's People

Stargazers

 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

hxcppdbg's Issues

Pause On Entry

A pause on entry option should be provided. The source maps will probably need to be updated to store the entry point so we can place a one shot breakpoint on the first line in that function.

Read the _hx_stackframe object

A lot of the complex driver specific frame mapping code could be simplified if we read back from the _hx_stackframe object. This object contains the haxe current function we're in as well as the class and line number. gencpp may need to be modified so the HXLINE isn't on the same line as the actual generated cpp so adding breakpoint remains easy.

Brackets and Stepping

Most other languages treat curly brackets as someting what can be stepped onto, currently curly brackets are ignored. This could be tricky as haxe doesn't require curly brackets, so the sourcemap may need to be enhanced to store information on curley brackets.

Anon Objects Missing Fields

Anon objects appear to report the wrong number of fields, I think this might be related to non-fixed fields.

Variable Attributes

The sourcemap should store attributes like final, static, member, etc, so that information can be provided in DAP responses.

Interger and Float Sizes

All integer and floats regardless of their size are stored in the same ModelData enum constructor. This means Int64s get truncated and there is no proper structured view of native integers. Might want an optional size argument in the model, where if there is none it a haxe integer / float.

enum IntSize {
    UInt8;
    SInt8;
    UInt16;
    ....
    Unspecified
}

ModelData.MInt(v : haxe.Int64, s : IntSize)

The model should also handled odd types like char, wchar_t, etc.

First Chance Exceptions

Currently exceptions cause the debugger to always break, an option to ignore first chance exceptions should be given to pause only on unhandled exceptions.

Detect Thread Types

Threads should be split into "Haxe" and "Native" threads. There are two ways we could go about detecting this.

  1. Scan the stack of a thread and see if it starts at the HxThread function.
  2. Read the hxcpp thread storage and compare thread IDs against that structure.

Interop Types

Currently cpp types such as cpp.ConstPointer, cpp.Pointer, etc don't have visualisers so will be treated as native objects. Should be easy enough to transform these into just pointers.

Target Stdio

Ideally the stdin, stdout, and stderr could be captured so it can be sent through DAP events. This doesn't seem easy to do with DbgEng, haven't checked LLDB yet.

Implement Function Arguments

DbgEng seems to model most function arguments wrapped in pointers. We need to provide typed function arguments in the sourcemap so we know how many (if any) levels of de-referencing we need to perform to get the actual object.

Conditional Breakpoints

Breakpoints should be able to have conditions applied to them, e.g.

  • Specific expression evaluates to true.
  • Breakpoint has been hit a specific number of times.

Map and Intrinsics as Dynamic Map Keys

Currently classes, arrays, and anon objects are the only supported types for keying into dynamic maps in the evaluator. Ints, Floats, and Maps should be supported as keys.

Broken Name Mapping

At somepoint name mapping has stopped working. You now see the managed name for objects / variables and need to use the managled name in the evaluator.

Make Debugger Objects Available in the Evaluator

Having information such as stack frames, threads, etc, readable in the evaluator could be useful. Maybe some sort of singleton hxcppdbg.Debugger object, the debugger may want to start to have a concept of the "current thread" which is the thread that caused the last debugger break.

Support Static Variables

Static variables are currently unsupported. Ideally these would be displayed in several ways.

  • For DAP, a new "statics" scope which contains all statics for type which is calling the current top of stack function.
  • For DAP, when expanding a class statics should be shown along side member variables.
  • In the evaulator by typing a fully qualified type name followed by the static name (e.g. myPackage.MyClass.myStatic)

Display Type of Generic Arguments

Currently the type of generic arguments are just ?. The sourcemap should be updated so that the type of generic arguments are stored. We can't really read this back from the target easily, as all generics get converted to Dynamic and its then hard to differenciate between an array of dynamic and an array of a specific class object.

Use Result type from hxcpp_luv_io

Since that library is already used and has its own Result type that should be used instead of whats essentially a duplicate we currently have.

Logging

When running outside of socket mode requests and responses should be logged to a file for easier debugging.

LLDB Data Model

Currently the data model doesn't exist for the LLDB driver, this is a pain because the LLDB API is very lacking in this department compared to DbgModel. Best chance is probably to to dip into the LLDB internals and sub-class the SyntheticChildrenFrontEnd and SyntheticChildrenProviderFrontEnd classes.

Slow Step In

In many cases a single "haxe" step in results in many "native" step ins (string allocations, boxing, GC collection, etc). If we are stepping into a haxe function and we find ourselves in the hxcpp internals we could immediately step out instead of repeatedly stepping in until we get out again.

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.