Unity – Save and load “Snapshots” of game for debugging?

I’m relatively new to Unity debugging, and I’ve got an issue that happens every so often about 2 minutes into playing through a scene. If I can do the following, it would save me a lot of time debugging:

  1. Pause the scene
  2. Save the snapshot
  3. Modify some code
  4. Play the snapshot saved in step 2
  5. Repeat 3-4

Is this at all possible with Unity, or should I just modify my code to running "closer" to the point I’m trying to debug?

Debugging mode in MySQL Workbench

When running queries in MySQL workbench, some of them are captured to the log file at either:

  • MySQL/Workbench/logs
  • MySQL/Workbench/sql_history

However, I’d like to see ALL the possible queries that MySQL workbench does. Is there a way to do this on the client-side, i.e., where MySQL workbench is running? For example, it would be nice to see how these graphs are being generated and the system data is being grabbed, etc.:

enter image description here

Debugging T-Sql code using Visual Studio 2019. Error message: frame not in module

Has anyone had success using Visual Studio 2019 for debugging T-SQL code, the way SSMS allows Step-into & Step-over?

When I hit debug (Alt-F5), gives me this error, after making some progress. Looks like once it hits the section of the code that calls another procedure, it gives this error.

Frame not in module.   The current stack frame was not found in a loaded module. Source cannot be shown for this location. 


1  ..    2  ..   3  SELECT 1 FROM sys.objects   4  SELECT dbo.SomeFunction(1)   5  UPDATE TABLE SET X = 1 ....   6   

It runs well, until line 3, once it hits line 4, where it is calling a different function, it throws the aboe error. In SSMS, that line just opens a new window with code for the function and show debugging progress for each F11 step-into — but not in Visual Studio 2019 (Version 16.7.1)


Remote debugging android app from another computer on different network

Is is it possible for Android development to remote debug an app from another network? I am not talking about WebView/Web Pages debugging but as stated here, as this page talks about remote debugging a WebView or web pages opened in any app and also I don’t think it will work on if device and computer are on different networks.

My scenario is that if Device A is connected to Computer A on Wifi A and I want to debug the app running on Device A from Computer B on Wifi B.

There is option to connect your device using the ADB wireless debugging using TCP-IP, but that requires the Device and Computer to be on the same network, but in my case device and computer are on another network.

Debugging Priority queue implementation supporting priority update [closed]

Please let me know if you require any additional information, but please help me out here.

For an efficient implementation of algorithms like Dijkstra’s and Prim’s, we require a priority queue that supports decrease priority operation. I’ve come up with the following code(heap based priority queue) for this which stores the index of each entry in the priority queue using a HashMap.

import java.util.HashMap; import java.util.NoSuchElementException;  public class Heap<Key extends Comparable<Key>> {     private Key[] heap;     private int maxN, n;     private HashMap<Key, Integer> map;     @SuppressWarnings("unchecked")     public Heap(int maxN) {         if(maxN < 0 ) throw new IllegalArgumentException();         this.maxN = maxN;         n = 0;         heap = (Key[]) new Comparable[maxN];         map = new HashMap<>();     }      boolean isEmpty() {         return n == 0;     }      boolean insert(Key e) {         if(n +1 > maxN) throw new IllegalArgumentException("maximum capacity reached " + maxN);         heap[n] = e;         map.put(e,n);         int i = n;         while ( (i+1)/2 - 1 >= 0){             if ( e.compareTo(heap[(i+1)/2 - 1]) < 0 ) {                 swap(i, (i+1)/2 - 1);                 i = (i+1)/2 - 1;             }             else                  break;         }         n++;         return true;     }      Key extractMin() {         if(n == 0) throw new NoSuchElementException("Priority queue underflow ");         Key min = heap[0];         swap(0, n-1);         map.remove(min);         n--;         int j = 0, s;         while(j <= n/2 - 1){             if(j == n/2 -1 && n == (j+1)*2 )                 s = (j+1)*2 - 1;             else                  s = heap[(j+1)*2 - 1].compareTo(heap[(j+1)*2]) < 0 ? (j+1)*2 - 1 : (j+1)*2;              if(heap[j].compareTo(heap[s]) > 0 ){                 swap(j, s);                 j = s;             }             else break;         }         return min;     }      Key delete(Key e){         if(!map.containsKey(e)) throw new NoSuchElementException(e+"does not exist ");         int j = map.get(e), s;         Key del = heap[j];         swap(j, n-1);         map.remove(e);         n--;         while( j <= n/2 - 1){             if(j == n/2 -1 && n == (j+1)*2)                 s = (j+1)*2 - 1;             else                 s = heap[(j+1)*2 - 1].compareTo(heap[(j+1)*2]) < 0 ? (j+1)*2 - 1 : (j+1)*2;              if(heap[j].compareTo(heap[s]) > 0 ){                 swap(j, s);                 j = s;             }             else break;         }         return del;     }      boolean decreasePriority(Key e){         if(n == 0)             return insert(e);         if(map.containsKey(e))             delete(e);         return insert(e);     }      private void swap(int i, int j) {         Key t = heap[i];         heap[i] = heap[j];         heap[j] = t;         map.replace(heap[i], i);         map.replace(heap[j], j);     }      @Override     public String toString() {         String res = "[";         int i;         for (i = 0; i < n-1; i++)             res += heap[i] + ", ";         res += heap[i]+"]";         return res;     } } 

For the problem I’m working on the program is supposed to output the total weight of the minimum spanning tree found by applying Prim’s algorithm. The input graph is a 500 node graph, and the answer obtained by this implementation is incorrect. I’m certain that the issue lies with the Heap and not with my implementation of Prim’s algorithm because using the inbuilt priority queue in java outputs the correct answer. Here is my Program running Prims’s algorithm.

import java.io.FileNotFoundException; import java.io.FileReader; import java.util.ArrayList; import java.util.List; import java.util.Scanner;  class Edge<Key>{     Key v;     int w;     public Edge(Key v, int w){         this.v = v; this.w = w;     }     @Override     public String toString(){         return "("+v+","+w+")";     } }  class vertex implements Comparable<vertex>{     int position, dis;     public vertex(int position){         this.position = position;         dis = Integer.MAX_VALUE;     }     @Override     public int compareTo(vertex v) {         if(dis > v.dis)             return 1;         if(dis < v.dis)             return -1;         return 0;     }     @Override     public String toString(){         return Integer.toString(position+1);     } } public class Prims {     public static void main(String[] args) throws FileNotFoundException {         Scanner in = new Scanner(new FileReader("prims.txt"));         int n = in.nextInt(), m = in.nextInt();         List<List<Edge<vertex>>> graph = new ArrayList<List<Edge<vertex>>>();         List<vertex> nodes = new ArrayList<vertex>();         for(int i = 0; i<n; i++){             graph.add(new ArrayList<>());             nodes.add(new vertex(i));         }         while(m-- > 0){             int u = in.nextInt()-1, v = in.nextInt()-1, w = in.nextInt();             graph.get(u).add(new Edge<vertex>(nodes.get(v), w));             graph.get(v).add(new Edge<vertex>(nodes.get(u), w));         }         in.close();         long st = System.currentTimeMillis();         System.out.println(prims(graph,nodes));         long end = System.currentTimeMillis();         System.out.println("Runtime = "+(end-st)+"ms");     }     static int prims(List<List<Edge<vertex>>> graph, List<vertex> nodes){         int n = graph.size(), weight = 0;         boolean[] inSpanTree = new boolean[n];         Heap<vertex> pq = new Heap<>(n);         inSpanTree[0] = true;         for(Edge<vertex> e : graph.get(0)){             e.v.dis = e.w;             pq.insert(e.v);         }         while(!pq.isEmpty()){             vertex u = pq.extractMin();             inSpanTree[u.position] = true;             weight += u.dis;             for(Edge<vertex> e : graph.get(u.position)){                 if(!inSpanTree[e.v.position]){                     if(e.v.dis > e.w){                         e.v.dis = e.w;                         pq.decreasePriority(nodes.get(e.v.position));                     }                 }             }         }         return weight;     } } 

If for this same implementation I use the inbuilt priority queue I get the correct output(-3612829)

static int prims(List<List<Edge<vertex>>> graph, List<vertex> nodes){         int n = graph.size(), weight = 0;         boolean[] inSpanTree = new boolean[n];         PriorityQueue<vertex> pq = new PriorityQueue<>();         inSpanTree[0] = true;         for(Edge<vertex> e : graph.get(0)){             e.v.dis = e.w;             pq.add(e.v);         }         System.out.println(pq);         while(!pq.isEmpty()){             vertex u = pq.poll();             if(u.position == 307)                 System.out.println(pq);             inSpanTree[u.position] = true;             weight += u.dis;             for(Edge<vertex> e : graph.get(u.position)){                 if(!inSpanTree[e.v.position]){                     if(e.v.dis > e.w){                         e.v.dis = e.w;                         pq.remove(nodes.get(e.v.position));                         pq.add(nodes.get(e.v.position));                     }                 }             }         }         return weight;     } 

My Heap implementation works for almost all test cases even up to 300 nodes. I don’t understand how to debug and find out where the problem lies. Here is the link to the Problem input:


Can someone please help me debug my Heap implementation, I’ve been stuck a long time with this now. Thanks in advance.

Problem while debugging services with WinDBG using GFLAGS

Please i have a little problem when i try to debug services using WinDBG and GFLAGS. Here’s some screeenshots resuming my problem, so, here’s what i did. First, i configured GFLAGS like this :

enter image description here Then, i lunched the service, and used the following command line : enter image description here

And finally, i had this error : enter image description here

If someone can help, it would be very great, Thanks a lot !

Remote receivers debugging using azure service bus does not work

After i published app (not sure if related) to app o365 catalog (not store) i cannot debug app installed (or uninstalling) receivers using azure service bus anymore. I even tried removing remote endpoints from app manifest, but it did not help.

I also needed to increment app version in manifest to be able to event attempt debugging as app with same version was already in app catalog.

This is what is in output window

Successfully installed app for SharePoint. Services/AppEventReceiver.svc has been registered on Windows Azure Service Bus successfully. Services/AppEventReceiver.svc has been registered on Windows Azure Service Bus successfully. 

When i click on start, app is uninstalled (if it is previously installed), then installed, then VS gets out of debug mode, then there are messages that service bus has been successfully registered. Then internet explorer starts and VS goes back to debug mode (probably for debugging javascript in IE), but this is after app installed receiver finishes (successfully btw).

Enable debugging via Windows Azure Service Bus is checked in project settings. Connection string to Azure Service Bus is provided. I created Service using powershell so it does support necessary authentication methods. Related web project is also set up in app project properties. Debugging using service bus worked for me on this project before.

Any ideas?

SharePoint Site url is not working for debugging a solution

For debugging a SharePoint solution I want to give test site URL in visual studio.

enter image description here

but since web application URL is already access mapped

(http://example:2344 -> http://example.com).  

When I try to give http://example.com URL in, it shows

“Remote SharePoint site connections are not supported “

enter image description here

How can I use http://example.com (Alternate Access Mapped Url) for debugging purpose since currently, I don’t have original URL (http://example:2344)?

Can an stolen Android phone with USB debugging enabled have screen lock bypassed?

My Android (8.0) phone was pickpocketed from me yesterday, it was immediately turned off by the thief, when I tried to locate it using Find My Device it shows as offline.

As being a programmer and a security enthusiast, I started to worry about what data can be vulnerable on the phone. I had a screen lock on but it didn’t have full-disk encryption enabled (my bad, I know).

I saw on the internet that people can bypass the screen lock using fastboot and deleting some files, is this only for rooted phones? or am I vulnerable too?

I probably had USB Debugging enabled as I developed an Android app in the past and tested it on my device (although I remember that you must trust the computer before using it, does it makes the phone vulnerable?).

My phone wasn’t rooted though, so I believe that for the thief to bypass the screen lock they would need to unlock my bootloader which would definitely wipe my data.

I’m only worried about the data, if the only way to bypass the screen lock would be to wipe the data, then I’m ok.

What are your thoughts on this?

IIS hangs when debugging with Visual Studio

I keep having this ridiculous issue that’s driving me mad. I happen to debug some code with Visual Studio (attached to all w3wp) and let’s say I get an exception and VS is set to catch all exceptions. I go check the exception and the item in cause, then I switch to browser to check something else and I go again in Visual Studio to check the item again and when I mouse over it, visual studio hangs like mad and takes around 10-15 seconds to come back. After that whatever I do I get the “previous operation has timed out” and iis is completely unresponsive, I cannot detach and it takes a ridiculous amount of time, somewhere around 5 minutes to come back. It’s completely dead. I kill all w3wp, vssphost, recycle, iisreset and it still doesn’t come back.

My colleagues don’t have this issue, if it hangs they just reattach and bam, it works. For me, never. I have no idea what’s different on my machine. Even on previous virtual machines, os installs same thing happened.

Settings of application pool: enter image description here

I appreciate any sort of help. Also feel free to ask for more details.