From: R. B. <ro...@pa...> - 2002-12-31 17:12:03
|
James Michael DuPont writes: > ok, let me put this in another way : > Is there a way to pull out all of the knowledge that you have about a > give bash routine into a file? or at least an interator function that > visits each node uniquly? Not that I know of. I don't see a need for this for debugger operations. If you have a need for this perhaps you could write something. > > I would like to have a routine that visits all the internal COMMAND and > WORD objects, so that I can use that as input into the introspector. > > The thing is that, I need to see : > 1. what file a node (COMMAND,WORD) comes from. > 2. what type it is (unary expr, function call, function decl) > 3. what line number/column it came from The bash "declare" statement can probably give some of this information. "declare -F" lists all functions. "declare -a" lists all arrays. A variable name can be given too. See the bash documentation on declare. (Note: make sure you look at the doc that comes with the debugger since in fact declare has been extended to give line and source file information for functions; it does this because the debugger needs that info.) Names that pertain to the debugger start _bashdb. But alas there are stll a few debugger variables however that don't start _bashdb; they all do start with an underscore though. > > I use the redland rdf lib for storing this information, and to be able > to gather all of that out of a ./configure file would be very usefull. > > Also, we need to figure out the sources before they are interpolated > and afterwards. In bashdb, the command "info files" lists all the file the debugger knows about - has seen so far. You can look at the code to find the array that stores that. _bashdb_file2var as mentioned before does the name mangling. From that, if you need a reverse mapping you can probably create it. |