This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: print implementation


> Can anyone tell me how gdb find variable'value when user type the
> 'print' command? Thank you!

Simply, find the variable's address in memory via debugging information, then visit the address. Mostly the local variable is fetched using this method. But if you print some complex variables or variables that located at other frames, thing will be extremely complicated as Jim said. You'd better read the source code.

Wenbo

--
Wenbo Yang
SimpLight Nanoelectronics Ltd.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]