Forum Xamarin.Forms

Edit code during debug session on Android

HarbHarb USMember ✭✭

Hi guys! This seems to be a quite noobish problem, nonetheless, still encountering the issue...
Some details: Xamarin Forms, PCL, Android emulator.
Is there any way to edit the code during a debug session? Also, is there a way to step back in the code during debugging? I assume the target emulator is not capable do these things, or is it? I also have a physical Android phone, which might help the situation.

Answers

  • RVxRVx USMember ✭✭
    edited April 2017

    As far as i know, and have ever heard off, it is not possible to change the code in runtime.

    Remember the code you see is not the code running. The code is compiled(changed to something a machine can understand. the source language or machine instructions ) and then run.
    you can however if you stop the code with a breakpoint edit a memory location. ex. change a string or an int.

    I have not heard of any way to step back when debugging that would require to save the entire "state"(all memory and storage) of the simulator for every code step and take massive amounts of memory.

    Edit: if you want to learn more there is more here:
    https://www.quora.com/How-does-a-programming-language-work
    https://en.wikipedia.org/wiki/Machine_code
    http://stackoverflow.com/questions/1515940/learning-how-programming-languages-work

    Edit2:
    And Xamarin is basicly an other layer of programming:

    Xamarin lets developers build native apps for Apple, Android, and Windows devices with a single language, C#, and a single IDE, either Visual Studio or Xamarin Studio. Whichever of these IDEs you use, you’ll have all the Software Developer Kits (SDKs) associated with not just the Windows platform (C# and Visual Studio are Windows tools) but the Android and Apple ones as well. So, instead of having to master all the languages, you can build native mobile apps for multiple device types using just one. Everything starts with C#, but Xamarin translates—or compiles—all the coding to make it work on the other device platforms.
    - Xamarin.iOS does full Ahead of Time (AOT) compilation to produce an ARM binary that’s compatible with Apple’s App Store.
    - Xamarin.Android uses Just in Time (JIT) compilation for Android devices.

    http://blog.apterainc.com/custom-software/how-does-xamarin-work

  • HarbHarb USMember ✭✭
    edited April 2017

    Thank you for your information!

    What you said is correct, although, what I asked is not impossible. In "casual" (WPF, ASP.NET, etc) .net programs the user is able to step back and alter the code as well. (Which is awesome.) Of course, in this situation the target device differs from the compiling one, where the code is developed.

  • DonpreciousDonprecious Member

    It will be possible soon.

  • ErdoganErdogan Member ✭✭✭

    any good news?

Sign In or Register to comment.