This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gdb seg violation during print command (more info)


David,

You, David Cogen, were spotted writing this on Fri, May 05, 2000 at 04:42:57PM -0400:
> > They are, we ignore the argument names completely.
> > Which is why i claim it's not gdb's fault.
> > It's the compiler telling gdb it's an int (void), not gdb.
> > --Dan
> 
> But I still must pass an int to a function declared int (int), not only to a
> function declared int (int arg), for the function to compile. Omitting "arg"
> is just telling the compiler that the argument is not used, so not to generate
> a "not used" warning.
> 
> Should I pursue this as a gcc bug?

Compile with -g -S, and inspect the 'stabs' directive of the .s file. You'll
see that with ``int testme(int arg)", the compiler is emitting a 
``.stabs "testme.F1..."'' stab and an ``.stabs "arg:p1..."'' to declare
an argument. When you use ``int testme(int)'', it'll only put out the
function stab; gdb has no way to know about the argument.

At this point, you have two alternatives to pursue:

1. Every stabs tag should have a name; gcc is not unreasonable when it
doesn't put out tags for anonymous arguments.
2. Empty-name tags are fine and are actually outputted by gcc occassionally.
Since gcc has the actual knowledge of the type, it should put out a
`` :p1...'' tag. gdb should be able to use it just fine.

Personally, I believe 2. What gcc people will believe is another matter.

Yours,
Anatoly.

-- 
Anatoly Vorobey,
mellon@pobox.com http://pobox.com/~mellon/
"Angels can fly because they take themselves lightly" - G.K.Chesterton

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]