Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: dps but with recursive safe pointer following #40

Open
Zhentar opened this issue Oct 15, 2018 · 2 comments
Open

Enhancement: dps but with recursive safe pointer following #40

Zhentar opened this issue Oct 15, 2018 · 2 comments

Comments

@Zhentar
Copy link
Contributor

Zhentar commented Oct 15, 2018

Regular dps:

> dps 26ee7c30
26ee7c30  2368c010
26ee7c34  13234900
26ee7c38  5f080100 d2d1!CSRGBToLinearTranslator::s_shaders+400f0
26ee7c3c  26db1aa8
26ee7c40  26ee74a8
26ee7c44  26e80020

Awesome recursive dps:

26ee7c30  2368c010  -> 50afffa8 jscript9!Js::JavascriptLibrary::`vftable'
26ee7c34  13234900  -> 50b35650 jscript9!Js::GlobalObject::`vftable'
26ee7c38  5f080100 d2d1!CSRGBToLinearTranslator::s_shaders+400f0
26ee7c3c  26db1aa8  -> 50afa570 jscript9!ScriptEngine::`vftable'
26ee7c40  26ee74a8  -> 21dd7da0  -> 50afffa8 jscript9!Js::JavascriptLibrary::`vftable'
26ee7c44  26e80020  -> 26a0cda0  -> 50afffa8 jscript9!Js::JavascriptLibrary::`vftable'

Ah! It is so much more clear what I am looking at now! And with colorization it's even better!

@jazzdelightsme
Copy link
Member

Hey, that's a cool idea. Did you actually try implementing it, or is that just a mockup?

@Zhentar
Copy link
Contributor Author

Zhentar commented Oct 16, 2018

I did indeed, although just as a quick hack that replaces the standard dps:

		private static ColorString _DefaultSymLookup(DbgEngDebugger debugger, ulong addr)
		{
			var tempCs = ColorString.Empty;
			int depth = 0;
			do
			{
				if (tempCs.Length > 0) { tempCs = tempCs + "-> " + DbgProvider.FormatAddress(addr, is32bit: true, useTick: true, numericNull: true) + " "; }
				if (debugger.TryGetNameByOffset(addr, out string symName, out ulong disp))
				{
					ColorString cs = tempCs + DbgProvider.ColorizeSymbol(symName);
					if (disp != 0)
						cs.AppendPushPopFg(ConsoleColor.Gray, "+" + disp.ToString("x"));

					return cs;
				}

				tempCs += " ";
				depth++;
			} while (addr > 4096 && depth < 5 && debugger.TryReadMemAs_pointer(addr, out addr));

			return tempCs;
		} // end _DefaultSymLookup()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants