Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Christopher J. Grayce <cgrayce@wasatch.ps.uci.edu>
Subject: gdb can't find command line args
Date: Thu, 31 Jul 1997 14:06:41 -0700	[thread overview]
Message-ID: <efd953c69b111cc0fa76937d0b173e45.axp-list@archive.invalid> (raw)

Dear Folks,

   I am bedeviled with gdb problems.  Can anyone hint at what might be
going on here?  I have a PC164 Alpha clone on which I installed RH 4.1
without significant incident, and then made a number of package
upgrades to from the RH 4.2 distribution using the rpm utility and
downloads from ftp.redhat.com. In particular, I got the latest gdb,
glibc, and binutils.  I believe I'm already running the latest gcc
for which there is an rpm.
   The kernel is 2.0.30 which built without error from the 2.0.30
source from ftp.funet.fi and the 2.0.30-0.1 patches from gatekeeper.
MILO is from the 2.0.30 source at gatekeeper, and also built without
error.
   Below I append a detailed description of one of the problems.  I
would be glad of any help.  Essentially my only use for this computer
is reasonably complex scientific C programming -- I don't give a damn
about web serving or having a cool window manager.  But not having a
reliable C debugger (or is it the compiler?) is an absolute curse.

Christopher Grayce
UCI Dept of Chemistry
--------------------------------------------------------------------------
Here is the output from the appropriate rpm -q commands:
--------------------------------------------------------------------------
(wasatch)home/cgrayce% uname -a
Linux wasatch.ps.uci.edu 2.0.30 #1 Thu Jul 31 04:26:50 PDT 1997 alpha
(wasatch)home/cgrayce% rpm -q gdb
gdb-4.16-6
(wasatch)home/cgrayce% rpm -q glibc
glibc-0.961212-5
(wasatch)home/cgrayce% rpm -q gcc
gcc-2.7.2.1-2
--------------------------------------------------------------------------
The biggest present problem gdb gives me is that it does not correctly
print out the values of variables (which, of course, makes it useless).
Here is a short program that illustrates this:
--------------------------------------------------------------------------
/* silly.c */
#include <stdlib.h>
#include <stdio.h>

typedef struct {
  double x ;
  double y ;
  double z ;
} xyz_triple ;

int main(int argc, char *argv[]) {

  xyz_triple fluid[2000] ;
  printf("argc = %d, argv = %p\n",argc,argv) ;
  return(0) ;
}
/* end */
--------------------------------------------------------------------------
And here is the result from running gcc and gdb on this code:
--------------------------------------------------------------------------
(wasatch)home/cgrayce% cc -g silly.c
(wasatch)home/cgrayce% gdb a.out
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (alpha-unknown-linux), Copyright 1996 Free Software Foundation, Inc...
(gdb) break 14
Breakpoint 1 at 0x1200008e8: file silly.c, line 14.
(gdb) run
Starting program: /home/cgrayce/a.out

Breakpoint 1, main () at silly.c:14
15        printf("argc = %d, argv = %p\n",argc,argv) ;
(gdb) print argc
$1 = 0                           <------ what??
(gdb) print argv
$2 = (char **) 0x0               <------ excuse me?!
(gdb) cont
Continuing.
argc = 1, argv = 0x11ffffb88

Program exited normally.
(gdb)

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

             reply	other threads:[~1997-07-31 21:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-31 21:06 Christopher J. Grayce [this message]
     [not found] <Pine.LNX.3.95.970801103025.11208A-100000@nexus.carleton.ca>
1997-08-02  5:24 ` gdb can't find command line args Christopher J. Grayce
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox