Science_Fiction
Science_Fiction

Reputation: 3433

WinDbg and inlined functions

I am trying to debug a crash dump and I want to check the value of some variable on the stack. Problem is some methods have been inlined in the release build but I want to dump the variables (dv) of this.

If I go to the stack frame and do a dv command it shows me all variables for that particular function but not those within the inlined call.

I can do a uf (unassmeble function) command to see the assembly code but its a lot of work figuring things out.

Upvotes: 0

Views: 1272

Answers (2)

snoone
snoone

Reputation: 5489

You're going to have to figure this out through disassembly, unfortunately. If you're not already comfortable with this then it's as good a time as any to start practicing, it's a valuable skill to have for debugging tough problems.

Also, while it doesn't help you now, the PDB file format generated by Visual Studio 2012 now does a better job of tracking inline functions. Thus, in the future this particular situation should be mitigated in most cases. You can read more about the feature here:

http://dotnet.dzone.com/news/debugging-optimized-code

Upvotes: 1

Andriy
Andriy

Reputation: 8594

It is not generally possible in an optimized build. The optimizer might decide not to allocate memory to a variable, so studying the assembly code to figure out which register is the variable in is the only way. Furthermore, if "Omit frame pointers" switch is on, the debugger wouldn't correctly show any variable allocated on stack.

You may try to add code to log variables you're interested in into a file.

Upvotes: 4

Related Questions