From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1265 invoked by alias); 31 Jan 2008 17:11:58 -0000 Received: (qmail 1257 invoked by uid 22791); 31 Jan 2008 17:11:57 -0000 X-Spam-Check-By: sourceware.org Received: from mail1.physik.fu-berlin.de (HELO mail1.physik.fu-berlin.de) (160.45.35.12) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 31 Jan 2008 17:11:25 +0000 Received: from g22.physik.fu-berlin.de ([160.45.34.122]) by mail1.physik.fu-berlin.de with esmtp (Exim 4.63) (envelope-from ) id 1JKcwW-0003TS-PU for gdb-patches@sourceware.org; Thu, 31 Jan 2008 18:11:22 +0100 Date: Thu, 31 Jan 2008 17:32:00 -0000 Message-ID: From: Florian Lorenzen To: gdb-patches@sourceware.org Subject: Plotting from GDB User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.7 Emacs/22.1 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Thu_Jan_31_18:11:16_2008-1"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit X-ZEDV-Virus-Scanned: No viruses found. [ClamAV 0.92/5627/Thu Jan 31 17:15:25 2008] X-ZEDV-Spam-Level: -- X-ZEDV-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on zs01.physik.fu-berlin.de X-ZEDV-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.3 X-ZEDV-Spam-Report: * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-01/txt/msg00857.txt.bz2 --pgp-sign-Multipart_Thu_Jan_31_18:11:16_2008-1 Content-Type: multipart/mixed; boundary="Multipart_Thu_Jan_31_18:11:16_2008-1" --Multipart_Thu_Jan_31_18:11:16_2008-1 Content-Type: text/plain; charset=US-ASCII Content-length: 460 Hello, I spent a lot of time debugging numerical codes. Very often, it is useful to plot a certain quantity instead of staring on numbers. To help with this, I wrote some small user defined commands to create a plot with gnuplot during the debugging session. Perhaps, you want to include it in your distribution, I attach you the file. (I know, DDD has this functionality, but perhaps CLI or Emacs users might be interested in this.) Best regards, Florian --Multipart_Thu_Jan_31_18:11:16_2008-1 Content-Type: text/plain; charset=US-ASCII Content-Disposition: attachment; filename="plot1d.gdb" Content-Transfer-Encoding: quoted-printable Content-length: 1349 # plot1d.gdb # # Copyright (C) 2008 Florian Lorenzen # # Plot an expression that expands to {x1, x2, ..., xN}, i. e. # N numbers using gnuplot. # # This file is for the GNU debugger 6.x. # # It writes temporary files named __plot1d.dump, __plot1d.dat, __plot1d.gp,= so # you should not have files of the same name in the working directory. # # It requires sed, awk, and gnuplot available in the $PATH. # plot1d_opt_range # # Plot the points of passing as plot options using # in the set yrange command. define plot1d_opt_range shell rm -f __plot1d.dump __plot1d.dat __plot1d.gp set logging file __plot1d.dump set logging on output $arg0 set logging off shell awk '{printf("%s", $0)}' < __plot1d.dump | \ sed 's/^{\(.*\)}$/\1/;s/, */\n/g' > __plot1d.dat shell echo "set yrange $arg2; plot '__plot1d.dat' $arg1 title '$arg0'; \ pause -1 \"Press enter to continue\"" > __plot1d.gp shell gnuplot __plot1d.gp shell rm -f __plot1d.dump __plot1d.dat __plot1d.gp end # plot1d # # Just plot the points of . define plot1d plot1d_opt_range $arg0 "" "[*:*]" end # plot1d_opt # # Plot the points of passing to the # plot command after the datafile. So, one can pass # "with lines" here. define plot1d_opt plot1d_opt_range $arg0 $arg1 "[*:*]" end --Multipart_Thu_Jan_31_18:11:16_2008-1-- --pgp-sign-Multipart_Thu_Jan_31_18:11:16_2008-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit Content-length: 189 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBHogE0vjzICpVvX7YRAtuvAJ9nsNoSPaeV7mgam+pqdFWlSo6sOQCcCkGr OZ7y+S/e4NVMrgKaxq3+aec= =3n/2 -----END PGP SIGNATURE----- --pgp-sign-Multipart_Thu_Jan_31_18:11:16_2008-1--