srinivas bakki | 1 Feb 2008 04:32
Picon
Favicon

Re: beginner


Thank you all people, it seems i have enough at hand
now. may be i'll keep pestering with all those silly
doubts though :)

Regards
Srinivas Bakki

--- Arun Paneri <p26a <at> yahoo.com> wrote:

> See this mail chain if it helps you  (Courtesy
> Michael Snyder)
> 
> Also go through this site
>
http://sourceware.org/gdb/current/onlinedocs/gdbint_toc.html
> 
> Regards.
> 
> var YAHOO = {'Shortcuts' : {}};
> YAHOO.Shortcuts.hasSensitiveText = false;
> YAHOO.Shortcuts.sensitivityType = [];
> YAHOO.Shortcuts.doUlt = false;
> YAHOO.Shortcuts.location = "us";
> YAHOO.Shortcuts.document_id = 0;
> YAHOO.Shortcuts.document_type = "";
> YAHOO.Shortcuts.document_title = "Re: Pls help:
> regarding gdb internals";
> YAHOO.Shortcuts.document_publish_date = "";
> YAHOO.Shortcuts.document_author =
(Continue reading)

M R Swami Reddy | 1 Feb 2008 12:44
Picon

Re: gdb testsuite

Hi Jim,

Thanks a bundle for your kind response.

> It's not obvious to me where the -lm comes from.  gdb/testsuite/lib
> contains a number of files that are also involved in running the
> tests; in particular, gdb_compile is defined in
> gdb/testsuite/lib/gdb.exp.

OK. I will explore the 'lib' directory.

> One unfortunate characteristic of the GDB test suite is that, even if
> GDB is horribly broken, many tests will still pass.  You can't have
> much confidence that things are basically working with 356 failures.
> You should look through gdb.log and work through a bunch of them to
> get a feel for the state of things.

Thats true. Yes, iam going through the gdb.log file and analyzing the
failures further.

> If you're going to do any significant amount of work with the test
> suite, I would recommend investing a little time in learning the Tcl
> language.  It's built on some very simple concepts, and knowing how
> those actually work, instead of guessing based on the resemblance
> between Tcl and more familiar languages, will save confusion in the
> future.  I think there are tutorials on-line somewhere.

OK. I will look into the Tcl language.

Thanks,
(Continue reading)

Igor Korot | 2 Feb 2008 20:30
Picon
Favicon

Intermittent error during the debugging

Hi, ALL,
I have a gdb 6.6 installed on the Gentoo Linux:
IgorsGentooOnNetwork igor # uname -a
Linux IgorsGentooOnNetwork 2.6.20-gentoo-r8 #1 SMP Sat Jun 2 00:28:19 PDT 2007 i686 Genuine Intel(R) CPU          
T1350   <at>  1.86GHz GenuineIntel GNU/Linux
I also have a KDevelop ver 3.4.1 (using KDE 3.5.5) installed.
All this is installed along with the GNOME.

I prepared the program using the wxGTK library, and wanted to debug it.
Unfrotunately gdb throws the error, which says:

"Debugger error

Debugger reported the following error.

Warnning: cannot insert breakpoint 0. Error accessing memory address 0xffffe420.
Input/Output error."

Now this errors appears intermittently, in different places at the
different times.

What is the cause of such issue? And how can I fix it?

Thank you.

Nick Roberts | 3 Feb 2008 23:20
Picon

Re: RE: -var-update using formatted value

Daniel Jacobowitz writes:
 > On Tue, Jan 15, 2008 at 11:32:16PM +0300, Vladimir Prus wrote:
 > > commit 67da794ce92c9af5fc9bc22721a942af27ade3d7
 > > Author: Vladimir Prus <vladimir <at> codesourcery.com>
 > > Date:   Tue Jan 15 23:29:36 2008 +0300
 > > 
 > >     Update stored value when format changes.
 > >     
 > >     	* varobj.c (varobj_set_display_format): Recomputed
 > >     	print_value.
 > >     	(c_value_of_variable): Return print_value.
 > 
 > This patch, with xstrdup instead of strdup, is OK.

Vladimir,

Can you please commit this change?

TIA

--

-- 
Nick                                           http://www.inet.net.nz/~nickrob

Neeraj kushwaha | 4 Feb 2008 05:53
Picon

value of local variable stored in register

Hi All,

I am trying to find the value of local variable stored in register.
But I am getting wrong value from gdb.
Here what i am trying

#include<stdio.h>

int main()
{
int *a=0;
volatile register int b=0xabcd;
 register int c=20;
printf("%x\n",b*c);
*a=0;
return 0;
}

------------------------------
-----------------------
GDB info:

Core was generated by `./a.out'.
Program terminated with signal 11, Segmentation fault.
 #0  0x080483e1 in main () at 1.c:9
9       *a=0;
(gdb) info local
a = (int *) 0x0
b = 43981
c = 11305136
(Continue reading)

Rohit Arul Raj | 4 Feb 2008 06:28
Picon

Re: value of local variable stored in register

Hi,

1. You are getting segmentation fault because of trying to write to a
invalid memory location (0x0) through pointer a;
2. It is not always true that if u give the storage class specifier as
"Register", a register will be allocated for the local variable. It
always depends on the compiler.
3. It is possible that for arithmetic operations, the compiler may
move your data to register from memory (operation: b*c & your
arithmetic operations does not support memory operands). In that case
u can look at the assembly generated.

Regards,
Rohit

On Feb 4, 2008 10:23 AM, Neeraj kushwaha <kushneeraj <at> gmail.com> wrote:
> Hi All,
>
> I am trying to find the value of local variable stored in register.
> But I am getting wrong value from gdb.
> Here what i am trying
>
> #include<stdio.h>
>
> int main()
> {
> int *a=0;
> volatile register int b=0xabcd;
>  register int c=20;
> printf("%x\n",b*c);
(Continue reading)

Vladimir Prus | 4 Feb 2008 07:15
Picon
Favicon

Re: RE: -var-update using formatted value

Nick Roberts wrote:

> Daniel Jacobowitz writes:
>  > On Tue, Jan 15, 2008 at 11:32:16PM +0300, Vladimir Prus wrote:
>  > > commit 67da794ce92c9af5fc9bc22721a942af27ade3d7
>  > > Author: Vladimir Prus <vladimir <at> codesourcery.com>
>  > > Date:   Tue Jan 15 23:29:36 2008 +0300
>  > > 
>  > >     Update stored value when format changes.
>  > >     
>  > >     * varobj.c (varobj_set_display_format): Recomputed
>  > >     print_value.
>  > >     (c_value_of_variable): Return print_value.
>  > 
>  > This patch, with xstrdup instead of strdup, is OK.
> 
> Vladimir,
> 
> Can you please commit this change?

Nick,
the change is now in.

Thanks,
Volodya

Neeraj kushwaha | 4 Feb 2008 07:39
Picon

Re: value of local variable stored in register

Hi Rohit,

thanks for the reply.

segmentation occurs due to unreferencing null pointer. (this was done
intensionally)
I am running gdb on core dump.

My main intention to get the value of the local variable stored in register.
From the dwarf dump information i can say it was stored in DW_OP_reg2.

Also if for the arithmetic operations, data is moved to register from
memory, but when the printf function returns all the saved register
value should be restored.

this is the dwarf information extracted from a.out

<1><  276>      DW_TAG_subprogram
               DW_AT_sibling               <341>
               DW_AT_external              yes(1)
               DW_AT_name                  main
               DW_AT_decl_file             1
/home/neeraj/SSG/Release2/gdblocal/2.c
               DW_AT_decl_line             5
               DW_AT_type                  <199>
               DW_AT_low_pc                0x80483a4
               DW_AT_high_pc               0x80483f5
               DW_AT_frame_base            [
0]<lowpc=0x0><highpc=0x4>DW_OP_breg4+4
                                       [ 1]<lowpc=0x4><highpc=0xa>DW_OP_reg1
(Continue reading)

Rohit Arul Raj | 4 Feb 2008 08:02
Picon

Re: value of local variable stored in register

Hi,

Then, the register value is getting corrupted due to the segmentation fault.
Try to set the break-point before the *a = 0 statement, and try to get
the register info and local variable info.

Regards,
Rohit

On Feb 4, 2008 12:09 PM, Neeraj kushwaha <kushneeraj <at> gmail.com> wrote:
>
> Hi Rohit,
>
> thanks for the reply.
>
> segmentation occurs due to unreferencing null pointer. (this was done
> intensionally)
> I am running gdb on core dump.
>
> My main intention to get the value of the local variable stored in register.
> From the dwarf dump information i can say it was stored in DW_OP_reg2.
>
> Also if for the arithmetic operations, data is moved to register from
> memory, but when the printf function returns all the saved register
> value should be restored.
>
> this is the dwarf information extracted from a.out
>
> <1><  276>      DW_TAG_subprogram
>                DW_AT_sibling               <341>
(Continue reading)

Rohit Arul Raj | 4 Feb 2008 08:42
Picon

Re: value of local variable stored in register

Hi,

Since the live range of value 'c' is dead after printf, the compiler
may be discarding it.
Try to use something like b = c + 200; after printf statement, so that
we extend the live range of variable 'c'.

Regards,
Rohit

On Feb 4, 2008 12:32 PM, Rohit Arul Raj <rohitarulraj <at> gmail.com> wrote:
> Hi,
>
> Then, the register value is getting corrupted due to the segmentation fault.
> Try to set the break-point before the *a = 0 statement, and try to get
> the register info and local variable info.
>
> Regards,
> Rohit
>
>
> On Feb 4, 2008 12:09 PM, Neeraj kushwaha <kushneeraj <at> gmail.com> wrote:
> >
> > Hi Rohit,
> >
> > thanks for the reply.
> >
> > segmentation occurs due to unreferencing null pointer. (this was done
> > intensionally)
> > I am running gdb on core dump.
(Continue reading)


Gmane