Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pierre Muller <muller@cerbere.u-strasbg.fr>
To: "Don Beusee" <Don.Beusee@oracle.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: small enhancements to gdb here..
Date: Tue, 21 Nov 2000 00:50:00 -0000	[thread overview]
Message-ID: <4.2.0.58.20001121092327.018aa100@ics.u-strasbg.fr> (raw)
In-Reply-To: <200011210757.eAL7vJx28709@dbeusee.us.oracle.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4176 bytes --]

At 08:57 21/11/00 , vous avez écrit:
>Hi,
>
>I originally sent this email to gnu-gdb@gnu.org before I saw the 
>CONTRIBUTE file.  I reformatted the diff output to your 
>specifications.  The diff's are based on 5.0 distribution at GNU's ftp site.
>
>I have patches for 3 small enhancements to improve convenience:
>
>- allow O/S commands directly from gdb when no match for internal command.
>- additional arg syntax in user-defined commands:
>     $#        number of args
>     $*        all args
>     $N        specific arg (where N is a number from 1 to 9).  $1 is the 
> first
>               arg (same as $arg0).
>     ${NN}     NN can be any number between 1 and MAXUSERARGS (10 currently).
>     ${ENV}    environment variable
>- a user command referencing an argument not provided on the command returns
>   an empty string, not an error.

   But this conflict with the history $n expansion !

Why not only keep $*, $# ${NN}

About ${ENV}
why shouldn't we also support things like
   ${$i}}
   if $i is a convinience variable then we would be able to write

    for ($i=0,i<$#,i++) do
       print arg $i is ${$i}}

Otherwise I don't think it is really useful to restrict to environment 
variables,
we could also search for ENV in the program being debugged.
  So ${I}
would give arg number 5 is I is convertable into a int a has the value 5.

Anyhow any way to get the Nnth arg where N is a variable would be most welcome.


One more question, are there no languages that accept
variables beginning with digits ?

I hope not, but maybe it is worth to ask ourselves this question !




Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99
From kevinb@cygnus.com Tue Nov 21 01:26:00 2000
From: Kevin Buettner <kevinb@cygnus.com>
To: gdb-patches@sourceware.cygnus.com
Subject: [PATCH] solib.c: solib_open() fix
Date: Tue, 21 Nov 2000 01:26:00 -0000
Message-id: <1001121092552.ZM19630@ocotillo.lan>
X-SW-Source: 2000-11/msg00279.html
Content-length: 2088

I've committed the following patch.  It fixes a crasher on Linux (and
probably most other native ports which use solib-svr4.c).

	* solib.c (solib_open): Handle the case where
	solib_absolute_prefix is NULL.

RCS file: /cvs/src/src/gdb/solib.c,v
retrieving revision 1.27
diff -u -p -r1.27 solib.c
--- solib.c	2000/11/21 01:09:54	1.27
+++ solib.c	2000/11/21 09:08:20
@@ -100,21 +100,25 @@ solib_open (char *in_pathname, char **fo
   int found_file = -1;
   char *temp_pathname = NULL;
 
-  if (solib_absolute_prefix != NULL &&
-      ROOTED_P (in_pathname))
+  if (ROOTED_P (in_pathname))
     {
-      int  prefix_len = strlen (solib_absolute_prefix);
+      if (solib_absolute_prefix == NULL)
+        temp_pathname = in_pathname;
+      else
+	{
+	  int  prefix_len = strlen (solib_absolute_prefix);
+
+	  /* Remove trailing slashes from absolute prefix.  */
+	  while (prefix_len > 0 && SLASH_P (solib_absolute_prefix[prefix_len - 1]))
+	    prefix_len--;
+
+	  /* Cat the prefixed pathname together.  */
+	  temp_pathname = alloca (prefix_len + strlen (in_pathname) + 1);
+	  strncpy (temp_pathname, solib_absolute_prefix, prefix_len);
+	  temp_pathname[prefix_len] = '\0';
+	  strcat (temp_pathname, in_pathname);
 
-      /* Remove trailing slashes from absolute prefix.  */
-      while (prefix_len > 0 && SLASH_P (solib_absolute_prefix[prefix_len - 1]))
-	prefix_len--;
-
-      /* Cat the prefixed pathname together.  */
-      temp_pathname = alloca (prefix_len + strlen (in_pathname) + 1);
-      strncpy (temp_pathname, solib_absolute_prefix, prefix_len);
-      temp_pathname[prefix_len] = '\0';
-      strcat (temp_pathname, in_pathname);
-
+	}
       /* Now see if we can open it.  */
       found_file = open (temp_pathname, O_RDONLY, 0);
     }
@@ -137,7 +141,7 @@ solib_open (char *in_pathname, char **fo
 
   /* Done.  If not found, tough luck.  Return found_file and 
      (optionally) found_pathname.  */
-  if (found_pathname != NULL)
+  if (found_pathname != NULL && temp_pathname != NULL)
     *found_pathname = strsave (temp_pathname);
   return found_file;
 }


       reply	other threads:[~2000-11-21  0:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200011210757.eAL7vJx28709@dbeusee.us.oracle.com>
2000-11-21  0:50 ` Pierre Muller [this message]
2000-11-30 15:04 Don Beusee
2000-11-30 15:26 Don Beusee
2000-11-30 15:38 ` Michael Snyder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4.2.0.58.20001121092327.018aa100@ics.u-strasbg.fr \
    --to=muller@cerbere.u-strasbg.fr \
    --cc=Don.Beusee@oracle.com \
    --cc=gdb-patches@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox