This is the mail archive of the gdb@sourceware.org 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]
Other format: [Raw text]

Re: bad function parameter values for C++ code in backtrace


On Thu, Mar 18, 2010 at 12:59 PM, Doug Evans <dje@google.com> wrote:
> On Thu, Mar 11, 2010 at 11:03 PM, Lalit Mohan Tripathi
> <lalit.mohan.tripathi@gmail.com> wrote:
>> Hi,
>>
>> I find problem with gdb backtrace for ?printing incorrect function
>> argument values in backtrace. ?Please let me know if it is some
>> limitation of gdb or a bug?
>>
>> The parameter values printed by the "bt" command in gdb is incorrect.
>> I've tried on ?x86 as well on ARM, the result is same (and incorrect
>> parameter values). ?For example, the down-most frame's function
>> parameter values is shown in the upper frame's function also.
>>
>> [...]
>> [user@localhost]$ gdb test2
>> GNU gdb Red Hat Linux (6.5-25.el5rh)
>> Copyright (C) 2006 Free Software Foundation, Inc.
>
> gdb 6.5 is pretty old.
> Have you tried a newer version of gdb? ?E.g. 7.0?
>

Yes, I tried gdb 7.0.  Sorry, the result of is correct.  GDB gives the
latest value of arguments in
backtrace at that instant not the actual passed value.
I'm trying to debug a similar problem with gdb where I get the wrong
parameter value when the program crashed.  The pasted example was
attempt to replicate that problem (that failed).  The problem I face
is that when my program crashes then I get invalid value in the
parameter in one of the lower frame.


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