Load Command
The commandline portion of Frysk(fhpd) has two different ways to get a process started down the road to debugging, either via the “fhpd” command itself or by using the “load” command after fhpd is started. Before Frysk can do anything with a process, it first must be “loaded”. A user can “load” a process in two different ways. The first way is by loading the process when the Frysk commandline process, fhpd, is activated. For example, if a user wants to debug “ls” and pass it the parameters of “-d /home” it can be done in either of these two ways:
[user@localhost.com] $ fhpd ls
[0.0] Loaded executable file: /bin/ls
(fhpd) run -d /home
running with this command: /bin/ls -d /home
Attached to process 27853
Running process 27853
/home
(fhpd)
or this way:
user@localhost.com] $ fhpd
(fhpd) load ls -d /home
[0.0] Loaded executable file: /bin/ls
(fhpd) run
running with this command: /bin/ls -d /home
Attached to process 27853
Running process 27853
/home
(fhpd)
Notice that the user does not have to enter the full path to the executable, Frysk looks for the executable in the paths listed in the user’s $PATH environment variable. The full path to the executable would have to be specified otherwise.
The example showed how a single process could be loaded, but the “load” command can handle multiple “loads” if you will. That is, the user is allowed to “load” as many processes as they need to, or they could load the same process multiple times possibly passing a different set of parameters each time. If the user wants to see what processes they have loaded at any point in time they can just issue the “load” command without any parameters and a list will be shown.
(fhpd) load ls /usr
[0.0] Loaded executable file: /bin/ls
(fhpd) load echo abcdefg
[1.0] Loaded executable file: /bin/echo
(fhpd) load true
[2.0] Loaded executable file: /bin/true
(fhpd) load
Loaded procs path-to-executable
[0.0] /bin/ls
[1.0] /bin/echo
[2.0] /bin/true
and, if the user wants to see what arguments were loaded with a particular process:
(fhpd) info args
The args list for: /bin/ls is…..
/usr
The args list for: /bin/echo is…..
abcdefg
The args list for: /bin/true is…..
(fhpd)
Unload Command
Once a process has been loaded, if the user does not want to actually start/run the process or the wrong process was loaded or a typo occurred, the “unload” command allows the user to remove a process from the list. For this purpose the “unload” command has 2 options for removing unwanted processes. The first way is by removing all of the processes by using this command:
(fhpd) unload -all
This will unload all of the processes that are currently loaded. The second way to remove unwanted loaded processes is to do it individually using the “-t” option like this:
(fhpd) unload -t xxx
where xxx is the major number to the ptset. For example, suppose you have 3 processes loaded and you want to delete the secomd one in the list. (NOTE The “unload” command works like the “load” command is that if no parameters are entered, a listing of the loaded processes is given.)
(fhpd) unload
Loaded procs path-to-executable
[0.0] /bin/ls
[1.0] /bin/echo
[2.0] /bin/true
(fhpd) unload -t 1
(fhpd) unload
Loaded procs path-to-executable
[0.0] /bin/ls
[2.0] /bin/true
Now the previsously-loaded process in slot [1.0], /bin/echo has been deleted from the loaded procs list.
Coming soon for “load”
Currently the user cannot examine information about a process yet when a process is loaded. Other infrastructure within Frysk is now getting in place where data structures and other environment variables can be interrogated when a “load” command is issued and the debuginfo is loaded for the process. See http://sourceware.org/bugzilla/show_bug.cgi?id=5408. Hopefully this will be implemented within the next few weeks.
Next blog subject
My next blog subject will be the use of the “start”/”run” command.
General Frysk info:
http://sourceware.org/frysk
Please visit this website for full information about Frysk, how to join its mailing list and where the Frysk developers can be found on IRC.