Frysk – the load/unload command

June 2, 2008 by rmoseley

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.

Announcing Frysk 0.3 Release

May 23, 2008 by rmoseley

For those unfamiliar with what a “frysk” is, it is a new generation open source debugger designed to keep pace with today’s hardware/software advances. For any info about frysk, please visit: http://sourceware.org/frysk. Sorry for the late posting of this(since the actual release was a couple of weeks ago), but I feel some very important milestones were met during the month of April that are noteworthy.

Each month, usually during the first week, a new release of frysk is published and an announcement is published. This date may vary slightly depending upon what software is being worked on and how close a new enhancement/bug fix is to being checked into the source repo.

And so, without further ado:

Announcing Frysk 0.3
———————-
http://sourceware.org/frysk/

Frysk is a debugging and monitoring framework being developed using
Java and C++. It is aimed at providing developers and system
administrators with the ability to examine and analyze multi-host,
multi-process, and multi-threaded systems while they are running.

This is the second release of Frysk. The initial release of Frysk occurred
on April 4, 2008 and was tagged as version 0.2.1.

Contributors to the 0.3 release were: Andrew Cagney, Thiago Jung
Bauermann, Mark Wielaard, Petr Machata, Phil Muldoon, Rick Moseley,
Sami Wagiaalla, Stan Cox and Teresa Thomas.

Here are some of the improvements that were incorporated during April:

- Exported a prototype of low level watchpoint api on IA32,X8664 (PPC* will be covered by IBM)
- Implemented the watch command which exposes the watchpoint api in fhpd.
- Updated various frysk man pages.
- Created ProcRunUtil and re-based fcatch,fstep,ferror ontop of it.
- Added ability to kill procs from fhpd.
- Solidified passing parameters to run command and reusing history.
- Added support for elf symbol look-ups.
- Removed the CDT parser from frysk.
- Rewritten ftrace to use more frysk infrastructure.
- Adapted frysk symbol search code so that it can be used by breakpoints, as well as expression evaluation.
- Fully implemented sysroot functionality in frysk.
- Improved and tested stepping, particularly stepping through signal handlers.
- Imported a newer version of upstream elfutils.
- Fixed breakpoints to work correctly through forks.

Known limitations: some test that are working in-tree fail when
installed.

To download this release, go to:

ftp://sourceware.org/pub/frysk/frysk-0.3.tar.bz2

or check for an update in your local GNU/Linux distro.

Rick
2008-05-23

Hello world!

May 23, 2008 by rmoseley

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!