Coder Social home page Coder Social logo

fpt's People

Contributors

diogotito avatar joajfreitas avatar pineman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

joajfreitas

fpt's Issues

Breakpoints

Try to break execution before the instruction is actually executed, somehow. Hard to do because pc is constant for at least 4 cycles, and obviously we don't want to pause execution 4 times in a row

fix "break" debugger command

Calling break(N) in the debugger triggers a panic in hlua

Example

When I run

RUST_BACKTRACE=1 cargo run debug <<EOF
print "gonna break 150"
break(150)
print "broke 150"
EOF

I'm expecting

gonna break 150

broke 150

CTRL-D

Instead, I'm getting this:

gonna break 150

thread 'main' panicked at library\core\src\panicking.rs:136:5:
attempted to leave type `&mut hlua::Lua<'_>` uninitialized, which is invalid
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/fcab24817c72ffbd6ffb66d92b7ddc0d3ee4d2f0/library\std\src\panicking.rs:597
   1: core::panicking::panic_nounwind_fmt
             at /rustc/fcab24817c72ffbd6ffb66d92b7ddc0d3ee4d2f0/library\core\src\panicking.rs:106
   2: core::panicking::panic_nounwind
             at /rustc/fcab24817c72ffbd6ffb66d92b7ddc0d3ee4d2f0/library\core\src\panicking.rs:136
   3: core::mem::uninitialized
             at /rustc/fcab24817c72ffbd6ffb66d92b7ddc0d3ee4d2f0\library\core\src\mem\mod.rs:692
   4: hlua::PushGuard<ref_mut$<hlua::Lua> >::into_inner<ref_mut$<hlua::Lua> >
             at C:\Users\diogotito\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hlua-0.4.1\src\lib.rs:228
   5: hlua::lua_functions::impl$2::push_to_lua<ref_mut$<hlua::Lua>,std::io::cursor::Cursor<ref$<slice2$<u8> > > >
             at C:\Users\diogotito\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hlua-0.4.1\src\lua_functions.rs:163
   6: hlua::lua_functions::LuaFunction<ref_mut$<hlua::Lua> >::load_from_reader<ref_mut$<hlua::Lua>,std::io::cursor::Cursor<ref$<slice2$<u8> > > >
             at C:\Users\diogotito\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hlua-0.4.1\src\lua_functions.rs:324
   7: hlua::lua_functions::LuaFunction<ref_mut$<hlua::Lua> >::load<ref_mut$<hlua::Lua> >
             at C:\Users\diogotito\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hlua-0.4.1\src\lua_functions.rs:338
   8: hlua::Lua::execute<enum2$<hlua::any::AnyHashableLuaValue> >
             at C:\Users\diogotito\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hlua-0.4.1\src\lib.rs:678
   9: fpt::debugger::DebuggerTextInterface::run
             at .\fpt\src\debugger.rs:353
  10: fpt_cli::debug
             at .\fpt-cli\src\main.rs:50
  11: fpt_cli::main
             at .\fpt-cli\src\main.rs:110
  12: core::ops::function::FnOnce::call_once<enum2$<core::result::Result<tuple$<>,enum2$<rustyline::error::ReadlineError> > > (*)(),tuple$<> >
             at /rustc/fcab24817c72ffbd6ffb66d92b7ddc0d3ee4d2f0\library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread caused non-unwinding panic. aborting.
error: process didn't exit successfully: `target\debug\fpt-cli.exe debug` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)

License?

Should we add a license to this project?

Which one should we use?

Stacktraces

Add stack traces to the emulator.

We can do this by just keeping track of the PC values when issuing calls. but it would be nicer if this somehow included debug information.

RGBDS usually outputs files like the one attached (typically with the .sym extension but github doesn't like that):
rst_timing.txt.

We could read this information and enrich the stacktraces with it.

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.