Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cant get gdb to list src or single step

594 views
Skip to first unread message

Cat 22

unread,
Jul 31, 2011, 5:31:26 PM7/31/11
to
I am having trouble getting gdb to work properly.
I did try installing the package it wants and that makes
the err msg go way but i still cant debug like i should be able to
e.g listing src single stepping etc.
I'm using a 2.6.38 kernel not the Mandriva kernel, but I dont think
gdb cares? (I dont think gdb relies on some integration with the
kernel does it?)

My make file uses these flags:
-Wall -O0 -g3 -Werror

A typical session is shown below
Any ideas?
Thanks,
Cat22

$ gdb --directory=${PWD} b_opt
GNU gdb 6.8-7mdv2010.0 (Mandriva Linux release 2010.0)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show
copying"
and "show warranty" for details.
This GDB was configured as "x86_64-mandriva-linux-gnu"...
(gdb) b main
Breakpoint 1 at 0x400808
(gdb) r
Starting program: /home/xxx/YYY/zzzz_zz/b_opt

Breakpoint 1, 0x0000000000400808 in main ()
Missing debug package(s), you should install: glibc-
debug-2.10.1-6.7mnb2.x86_64
(gdb) l
1 rtld.c: No such file or directory.
in rtld.c
(gdb) l main
No line number known for main.
(gdb)

Roy Strachan

unread,
Aug 4, 2011, 5:22:45 PM8/4/11
to
On Sun, 31 Jul 2011 14:31:26 -0700, Cat 22 wrote:

> I am having trouble getting gdb to work properly.
> I did try installing the package it wants and that makes the err msg go
> way but i still cant debug like i should be able to e.g listing src
> single stepping etc.
> I'm using a 2.6.38 kernel not the Mandriva kernel, but I dont think gdb
> cares? (I dont think gdb relies on some integration with the kernel does
> it?)
>
> My make file uses these flags:
> -Wall -O0 -g3 -Werror


you need the -ggdb flag to create the debug info


>
> A typical session is shown below Any ideas?
> Thanks,

[snip]

Cat22

unread,
Aug 5, 2011, 10:14:05 PM8/5/11
to
even with the -ggdb flag i get this when trying to list the soruce lines

Tauno Voipio

unread,
Aug 6, 2011, 3:58:49 AM8/6/11
to

Try again:

delete all .o files and the run file
change the compiler options to

-Wall -O0 -g -pedantic

and make the code.

--

Tauno Voipio

jacob navia

unread,
Aug 6, 2011, 3:59:43 AM8/6/11
to
Le 06/08/11 04:14, Cat22 a écrit :

BUY a debugger and do not use gdb, it is quite buggy, as you can see.

For instance TotalView is an excellent debugger for linux.

If nobody buys developer tools, linux developers will be stuck forever
with bad quality software.

I reported a bug to gdb and a patch to fix it several years ago.
The bug is still there.

If you BUY a debugger, by the way, you will get maintenance, and not

THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS
WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

You get what you pay for.

Alan Curry

unread,
Aug 6, 2011, 6:38:17 AM8/6/11
to
In article <j14hjh$8fs$1...@dont-email.me>, Cat 22 <ca...@invalid.org> wrote:
>I am having trouble getting gdb to work properly.
>I did try installing the package it wants and that makes
>the err msg go way but i still cant debug like i should be able to
>e.g listing src single stepping etc.

I have a hunch...

>
>My make file uses these flags:
> -Wall -O0 -g3 -Werror

Actually uses them, or assigns them to a macro that never got added to the
compile command?

--
Alan Curry

Jens Thoms Toerring

unread,
Aug 6, 2011, 8:23:19 PM8/6/11
to
jacob navia <ja...@spamsink.net> wrote:
> Le 06/08/11 04:14, Cat22 a écrit :
> > On Thu 8/4/2011 2:22 PM, Roy Strachan wrote:
> >> On Sun, 31 Jul 2011 14:31:26 -0700, Cat 22 wrote:
> >>
> >>> I am having trouble getting gdb to work properly.
> >>> I did try installing the package it wants and that makes the err msg go
> >>> way but i still cant debug like i should be able to e.g listing src
> >>> single stepping etc.
> >>> I'm using a 2.6.38 kernel not the Mandriva kernel, but I dont think gdb
> >>> cares? (I dont think gdb relies on some integration with the kernel does
> >>> it?)
> >>>
> >>> My make file uses these flags:
> >>> -Wall -O0 -g3 -Werror
> >>
> >>
> >> you need the -ggdb flag to create the debug info
> >>
> >>
> >>>
> >>> A typical session is shown below Any ideas?
> >>> Thanks,
> >> [snip]
> > even with the -ggdb flag i get this when trying to list the soruce lines
> > (gdb) l main
> > No line number known for main.
> > (gdb)
> >

> BUY a debugger and do not use gdb, it is quite buggy, as you can see.

Sorry, but that's hilarious. This hints not at a bug in gdb but at
mistakes in installing or using gdb. And I've been using gdb now
for nearly 20 years and, like all programs ever written, it had
some bugs and will have bugs in the future. But there hasn't been
one that really was a complete show-stopper. And programs you have
to pay for also have bugs and will continue to have bugs (the num-
ber may be smaller if you are prepared to pay really lots and lots
of money, like for life-and- death-critical software for airplanes
and space shuttles etc.)

> For instance TotalView is an excellent debugger for linux.

> If nobody buys developer tools, linux developers will be stuck forever
> with bad quality software.

Sorry, that's simply BS. This indirectly implies that Linux
itself is bad quality software since you don't have to pay
for it. Or is there a significant difference between the kernel
developers and the tools developers? I would guess those two
groups even have quite a bit of overlap.

> I reported a bug to gdb and a patch to fix it several years ago.
> The bug is still there.

One bug report not having been fixed in years could also indi-
cate that it wasn't a bug but something the reported felt to be
a bug but others didn't consider as such. Would you care to give
a link or some other piece of further information?

> If you BUY a debugger, by the way, you will get maintenance, and not

> THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS
> WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
> ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

> You get what you pay for.

Now, if you don't know yet, Jacob Navia has written a C compiler
- see for example (but I don't know if it's the official page)

http://www.cs.virginia.edu/~lcc-win32/

and associated tools he is making available for free under some
circumstances and sells under others. And that's absolutely fine
and laudable - he must pay his rent and other costs of living as
everyone of us. But his claim that tools you have to pay for are
better per se is unwarranted in every respect. He may supply the
best support in the world to his customers (I'm far from claiming
anything else - I can't tell since I didn't buy his products yet)
but a sweeping statements like his has no foundation in reality.
Too many products you pay for come with an EULA that basi cally
says:

WHATEVER YOU PAID US, WE TAKE NO RESPONSIBILTY FOR OUR PRODUCT.
USE IT LIKE YOU WANT (but look for the fine print what you're
not allowed to do our lawyers will have an interesting discus-
sions with you). BUT YOU CAN'T SUE US IF IT DOESN'T WORK. AND
DON'T ASK TO GET YOUR MONEY BACK, YOU HAVE NO CHANCE IN HELL
OF GETTING EVEN A SINGLE PENNY.

I also have written software that is for free. And I have been
paying my rent and other costs of living by contracting with
regard to those bits of software (if people wanted me to install,
modify or extend it). But I don't think that the rate of errors
I made was significantly lower when I got paid for writing code
(it might be even the other way round - if I have to write some-
thing that I get paid for but which actually is rather boring
the rate of errors might be higher than when I'm doing something
I'm really interested in for it's own sake). Of course, people
having paid me will rather likely jump to the top of the queue
if they encounter problems they need help with in case there are
more requests than I can handle at once, but that's it mostly (and
that's also weighted a bit by how friendly or at least polite some-
one is when asking for help;-)

In my opinion, it's not "You get what you paid for" but "You
get what the developers are really interested in, whatever may
be motivating them (and how you approach them)" - and I have a
deeply lurking feeling that developers motivated by just money
alone are inferior per se to developers motivated by a self-sus-
taining interest in what they're doing.

Regards, Jens
--
\ Jens Thoms Toerring ___ j...@toerring.de
\__________________________ http://toerring.de

Cat22

unread,
Aug 9, 2011, 7:37:29 AM8/9/11
to
DOH! I found the problem. I had a mispelling of CFLAGS in my Makefile
that was preventing them from being used.
I hate it when that happens
Thanks
Cat22

0 new messages