gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gdb] Upper-level variable monitor


From: Bill Galbraith
Subject: [Gdb] Upper-level variable monitor
Date: Fri, 24 Jan 2003 15:34:13 -0500

My apologies if this is the wrong list to post this to, but after a thorough search (probably not thorough enough), this was the best place I could find for this. If someone could suggest a better place for this, please do. This email comes with a lot of work in the past trying to solve this problem, and I'm getting frustrated. I'm not a compiler designed guru, so I thought I might turn to you folks for some help.
 
 
What I am looking for is an upper-level variable monitor program. GDB acts as a lower-level variable monitor, and stops the execution of the program in question every time that it hits a breakpoint. An upper-level variable monitoring program would be one that runs in background to my real-time (okay, 60 hz) program, and would allow me to display the values of program variables. This is being applied to flight simulation programs, so a good example would be to monitor the speed of an engine as it spools up. With GDB, it would stop every frame (or whatever), but maybe I just want to watch the values change as the engine spools up, and watch the oscillations as the software modeling the engine causes it to oscillate. Like GDB, I want to display the values in their appropriate display format (boolean, integer, real, etc), and would like to be able to change the values of program variables. Like GDB, I would also like to display and change the values of enumerated types in their appropriate format. For example, in Ada, if I have an enumerated type of OFF_OR_ON, I want to change a variable by saying "Change SWITCH ON".
 
I have written programs to perform a similar function in Ada, using the 'address function. This required me to write specific code for each enumerated type in the simulation program (and there were hundreds), including all enumerated types, records, arrays, etc. By using other tick attributes, I was able to convert a string read from the command line containing the variable and desired value, determine the address and value to stuff into that address. This worked, but the drawback was that any time a new type was added, specific code also had to be added to handle the displaying and changing of this new type.
 
Now, my current approach has been to look into the ELF specification. Apparently, the information that I am looking for (variable name, address, type, etc) is contained in the header, since GDB is capable of displaying enumerated types properly for Ada programs. When I use READELF, NM, or OBJDUMP, I see the program variables (along with a lot of other stuff), and their addresses, but I don't see any indication for the type, etc. The info must be there, but where?
 
So, if someone (if anyone is still awake) could suggest anything that would either help me trudge through the ELF spec, or knows of a program that might do what I would like to do, I would really appreciate it. Another path might be to try to understanf how GDB (and it's Ada variant) handles this stuff.
 
Thanks,
Bill

reply via email to

[Prev in Thread] Current Thread [Next in Thread]