GDB - "running program??!!!"

GDB - "running program??!!!"

Post by Martin Wurstho » Sun, 26 Nov 1995 04:00:00



    Jamie> Hi, I looked in the man pages, and everywhere else I can
    Jamie> think of, but cannot seem to understand why gdb is
    Jamie> relogging me in everytime I debug a program. (I'm *NOT* a c
    Jamie> programmer, so there could be something really obvious that
    Jamie> I'm missing, but..)

    Jamie> gdb hello
    Jamie> me - step
    Jamie> gdb - program not running me - run gdb
    Jamie> - appears to be running bash -login

    Jamie> The "hello" program isn't run.

You have to tell gdb explicitly to run the program: first define your
breakpoints and then execute "run" (not "run gdb"!).

--
------------------------------------------------------------------------
Martin Wursthorn                                  Universit"at Stuttgart
Tel. (+49 711) 685 5517                           Mathematisches Inst. B
Fax. (+49 711) 685 5322                           3. Lehrstuhl
------------------------------------------------------------------------

 
 
 

GDB - "running program??!!!"

Post by Jamie Hoglu » Sun, 26 Nov 1995 04:00:00


Hi, I looked in the man pages, and everywhere else I can think of, but
cannot seem to understand why gdb is relogging me in everytime I debug
a program. (I'm *NOT* a c programmer, so there could be something really
obvious that I'm missing, but..)

#include <stdio.h>

main()
{
  int I = 24;

  printf("Hello World %d \n",I);
  return 0;

Quote:}

This works on the command line, but when I try to step through it using gdb
gdb loggs me in again, doesn't run "hello world" and I have to exit.

gdb hello
me - step
gdb - program not running
me - run
gdb - appears to be running bash -login

The "hello" program isn't run.

Of course I don't really need to use a de* for "hello world", but I
do need one for what I'd like to do.

I tried to set break points, that didn't work either. (I even tried using
gdb as my login shell, that really didn't work)

Is there something obvious that I'm missing? The code was compiled with
debugging information on it, I am able to list it, just not step through it.

Just out of curiousity, is there a de* simmiliar to Microsoft Codeview
that works for Linux?

Hope someone can tell me what I'm doing wrong.

 
 
 

GDB - "running program??!!!"

Post by Jamie Hoglu » Tue, 28 Nov 1995 04:00:00



: You have to tell gdb explicitly to run the program: first define your
: breakpoints and then execute "run" (not "run gdb"!).

I didn't type run gdb, I just typed run that didn't work, so I typed run
hello, no good, then run gdb, nothing worked.

It turns out that I had misconfigured a "user" for doing de* work,
using a script as a login "shell" is not a good idea I guess.

Of course running gdb as root would have (and did) point this problem out,
but I didn't know what gdb would do, and I didn't want a bunch of files
put all over who knows where.

Does anyone know if there is a curses based de*? (Ideally like
MS-Codeview) If not, is there a clever way of separating the various
information gdb spits out?  What do you folks do to make gdb "friendly"?

Thanks.

Jamie