Re: Gdb Digest, Vol 24, Issue 2

"Jaskiran Singh" <[email protected]>
Newsgroups gmane.comp.gdb.general
Organization TataInfotech Ltd
Message-ID <[email protected]>
you have to compile your code with
g++ -g -o <myfile.exe> <myfile.c>

now run
gdb myfile.exe

Jas

----- Original Message -----
From: <[email protected]>
To: <[email protected]>
Sent: Thursday, December 16, 2004 10:29 PM
Subject: Gdb Digest, Vol 24, Issue 2


> Send Gdb mailing list submissions to
> [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.gnu.org/mailman/listinfo/gdb
> or, via email, send a message with subject or body 'help' to
> [email protected]
>
> You can reach the person managing the list at
> [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Gdb digest..."
>
>
> Today's Topics:
>
>    1. problem seeing executable file (Jon Hatchett)
>    2. Re: problem seeing executable file (Ben Elliston)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 16 Dec 2004 09:11:01 +0900
> From: Jon Hatchett <[email protected]>
> Subject: [Gdb] problem seeing executable file
> To: [email protected]
> Message-ID: <[email protected]>
> Content-Type: text/plain
>
> Dear all,
>
> I am afraid I have a very simple problem but I am not very good with
> Linux. I want to use gdb (here on a test program a.out), but it seems
> that gdb cannot see the file even though from the directory it runs
> fine.
>
> bash-2.05b$ a.out
> hello world
> bash-2.05b$ gdb a.out
> GNU gdb Red Hat Linux (6.0post-0.20040223.17rh)
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
> are
> welcome to change it and/or 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.
> This GDB was configured as
> "i386-redhat-linux-gnu"..."/home/jonh/dynamicrewire/numerics/a.out": not
> in executable format: File format not recognized
>
> If I type path I get
>
> Executable and object file path:
> .:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin
>
> so the present directory does seem to be in the path.
>
> Sorry for such a stupid question, any help would be appreciated,
>
> thanks,
>
> Jon Hatchett
>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: 16 Dec 2004 13:29:08 +1100
> From: Ben Elliston <[email protected]>
> Subject: [Gdb] Re: problem seeing executable file
> To: [email protected]
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=us-ascii
>
> Jon Hatchett <[email protected]> writes:
>
> > I am afraid I have a very simple problem but I am not very good with
> > Linux. I want to use gdb (here on a test program a.out), but it
> > seems that gdb cannot see the file even though from the directory it
> > runs fine.
>
> > bash-2.05b$ a.out
> > hello world
> > bash-2.05b$ gdb a.out
> [...]
> > "i386-redhat-linux-gnu"..."/home/jonh/dynamicrewire/numerics/a.out": not
> > in executable format: File format not recognized
>
> > .:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin
> > so the present directory does seem to be in the path.
>
> GDB doesn't search the path for files.  You need to either give the
> full path to a.out, or you need to cd into that directory before
> running GDB.
>
> BTW, having . at the front of your path is probably not wise.
>
> Cheers, Ben
>
>
>
>
>
>
> ------------------------------
>
> _______________________________________________
> Gdb mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/gdb
>
>
> End of Gdb Digest, Vol 24, Issue 2
> **********************************
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.