TCSGrad
TCSGrad

Reputation: 12108

How to change the value of a variable from WinDbg cmd line?

There's an extern variable defined in the code, which I need to set to true/false through the debugger (for enhanced debug dumps and stuff). What would be the command to change its value from the cmd line in windbg (equivalent to gdb's p flag=1?

Upvotes: 0

Views: 5197

Answers (2)

snoone
snoone

Reputation: 5489

You can also use the Edit Memory command e to edit a byte:

eb module!variable value

Note that there's also ew, ed, eq, ep, etc.

-scott

Upvotes: 1

TCSGrad
TCSGrad

Reputation: 12108

Got it :

?? <module>!<variable>=<value>

Upvotes: 2

Related Questions