Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Re: beginner
@ 2008-01-31 15:28 Arun Paneri
  2008-02-01  3:33 ` beginner srinivas bakki
  0 siblings, 1 reply; 4+ messages in thread
From: Arun Paneri @ 2008-01-31 15:28 UTC (permalink / raw)
  To: srinivasbakki; +Cc: gdb

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 = "msnyder@specifix.com";
YAHOO.Shortcuts.document_url = "";
YAHOO.Shortcuts.document_tags = "";
YAHOO.Shortcuts.annotationSet = {

};

On 
Wed, 
2008-01-16 
at 
11:59 
-0800, 
Arun 
Paneri 
wrote:
> 
Hi 
All,
> 
>  
I 
am 
new 
to 
gdb 
code 
and 
trying 
to 
learn 
more 
things. 
i 
need 
help 
regarding 
gdb 
internals.
> 
> 
Can 
anyone 
write 
few 
lines 
about 
how 
does 
gdb 
internally 
works.
>  
I 
went 
to 
"Gdb 
internals 
guide" 
but 
couldn't 
find 
much 
information 
> 
specifically 
which 
i 
am 
looking 
for. 
I 
want 
information 
like 
> 
when 
we 
give 
command
> 
"$gdb 
test.exe" 
> 
then 
how 
internaly 
it 
works. 
Does 
it 
start 
reading 
symbols
>  
and 
start 
making 
symbol 
table 
with 
this 
command 
? 

Yes.

> 
Does 
it 
start 
creating 
stack 
frames 
as 
we 
give 
command 
"run" 
or 
before 
even 
that 
with 
"$gdb 
test.exe"?

No, 
and 
no.  
Before 
you 
"run" 
a 
program, 
there 
are 
no 
stack 
frames.
But 
gdb 
does 
not 
start 
constructing 
its 
internal 
stack 
frame
representation 
until 
the 
program 
STOPS, 
eg. 
at 
a 
breakpoint 
or
after 
executing 
a 
"step".

>  
I 
am 
basically 
interested 
to 
know 
about 
creation 
of 
frames 
and 
how 
does 
gdb 
read 
them 
back 
when 
we 
give 
"backtrace" 
command? 

For 
performance 
reasons, 
gdb 
tries 
to 
construct 
its 
stack 
frame
data 
lazily 
-- 
it 
postpones 
the 
work 
whenever 
possible.

So, 
in 
general, 
whenever 
the 
program 
stops, 
gdb 
will 
construct
one 
(and 
hopefully 
only 
one) 
stack 
frame 
-- 
the 
one 
for 
the 
function 
in 
which 
the 
program 
stopped.

If 
you 
give 
the 
"up" 
command, 
gdb 
will 
construct 
the 
next
(one) 
stack 
frame.

If 
you 
ask 
for 
"backtrace 
10" 
it 
will 
construct 
the 
next
ten 
stack 
frames.  
And 
if 
you 
ask 
for 
a 
full 
backtrace, 
gdb 
will 
construct 
as 
many 
stack 
frames 
as 
it 
can 
find.

> 
> 
I 
am 
not 
sure 
but 
i 
think 
to 
creat 
a 
frame 
it 
calls 
_initialize_stack 
(void)

No.  
That 
function 
is 
the 
initializer 
for 
the 
"stack.c" 
module.
It 
is 
called 
when 
gdb 
starts 
up, 
and 
just 
initializes 
the 
infrastructure 
for 
stack 
manipulation.

>  
and 
from 
this 
it 
calls 
fun_command(char 
*arg, 
int 
from_tty) 
then 
parse_frame_specification(char 
*frame_exp) 
& 
then 
create_new_frame(CORE_ADDR 
addr, 
CORE_ADDR 
pc) 
function.

Start 
with 
the 
function 
"get_prev_frame", 
and 
work 
your 
way 
up 
(and
down) 
from 
there.









----- Original Message ----
> srinivas
> 
bakki
> 
wrote:
> >
> 
Hi
> 
people,
> > 
> 
I
> 
wanted
> 
to
> 
start
> 
going
> 
through
> 
the
> 
GDB
> >
> 
source
> 
code
> 
to
> 
learn
> 
how
> 
it
> 
is
> 
implemented,
> 
what
> 
goes
> >
> 
into
> 
the
> 
application
> 
and
> 
its
> 
various
> 
nuances,
> 
perhaps
> >
> 
in
> 
a
> 
direction
> 
to
> 
be
> 
an
> 
active
> 
contributor
> 
to
> 
gdb.
> > 
> >
> 
But
> 
am
> 
not
> 
able
> 
to
> 
get
> 
a
> 
clue
> 
for
> 
the
> 
starting
> 
point.
> >
> 
where
> 
should
> 
i
> 
start
> 
digging
> 
the
> 
code
> 
?
> > 
> >
> 
Would
> 
be
> 
great
> 
if
> 
you
> 
people
> 
help
> 
me
> 
through
> 
this.
> 
> man
> 
ptrace
> 
> You
> 
should
> 
have
> 
a
> 
good
> 
understanding
> 
of
> 
how
> 
the
> 
unix
> process
> 
works
> 
first.
> 




      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: beginner
  2008-01-31 15:28 beginner Arun Paneri
@ 2008-02-01  3:33 ` srinivas bakki
  0 siblings, 0 replies; 4+ messages in thread
From: srinivas bakki @ 2008-02-01  3:33 UTC (permalink / raw)
  To: Arun Paneri; +Cc: gdb


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@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 =
> "msnyder@specifix.com";
> YAHOO.Shortcuts.document_url = "";
> YAHOO.Shortcuts.document_tags = "";
> YAHOO.Shortcuts.annotationSet = {
> 
> };
> 
> On 
> Wed, 
> 2008-01-16 
> at 
> 11:59 
> -0800, 
> Arun 
> Paneri 
> wrote:
> > 
> Hi 
> All,
> > 
> >  
> I 
> am 
> new 
> to 
> gdb 
> code 
> and 
> trying 
> to 
> learn 
> more 
> things. 
> i 
> need 
> help 
> regarding 
> gdb 
> internals.
> > 
> > 
> Can 
> anyone 
> write 
> few 
> lines 
> about 
> how 
> does 
> gdb 
> internally 
> works.
> >  
> I 
> went 
> to 
> "Gdb 
> internals 
> guide" 
> but 
> couldn't 
> find 
> much 
> information 
> > 
> specifically 
> which 
> i 
> am 
> looking 
> for. 
> I 
> want 
> information 
> like 
> > 
> when 
> we 
> give 
> command
> > 
> "$gdb 
> test.exe" 
> > 
> then 
> how 
> internaly 
> it 
> works. 
> Does 
> it 
> start 
> reading 
> symbols
> >  
> and 
> start 
> making 
> symbol 
> table 
> with 
> this 
> command 
> ? 
> 
> Yes.
> 
> > 
> Does 
> it 
> start 
> creating 
> stack 
> frames 
> as 
> we 
> give 
> command 
> "run" 
> or 
> before 
> even 
> that 
> with 
> "$gdb 
> test.exe"?
> 
> No, 
> and 
> no.  
> Before 
> you 
> "run" 
> a 
> program, 
> there 
> are 
> no 
> stack 
> frames.
> But 
> gdb 
> does 
> not 
> start 
> constructing 
> its 
> internal 
> stack 
> frame
> representation 
> until 
> the 
> program 
> STOPS, 
> eg. 
> at 
> a 
> breakpoint 
> or
> after 
> executing 
> a 
> "step".
> 
> >  
> I 
> am 
> basically 
> interested 
> to 
> know 
> about 
> creation 
> of 
> frames 
> and 
> how 
> does 
> gdb 
> read 
> them 
> back 
> when 
> we 
> give 
> "backtrace" 
> command? 
> 
> For 
> performance 
> reasons, 
> gdb 
> tries 
> to 
> construct 
> its 
> stack 
> frame
> data 
> lazily 
> -- 
> it 
> postpones 
> the 
> work 
> whenever 
> possible.
> 
> So, 
> in 
> general, 
> whenever 
> the 
> program 
> stops, 
> gdb 
> will 
> construct
> one 
> (and 
> hopefully 
> only 
> one) 
> stack 
> frame 
> -- 
> the 
> one 
> for 
> the 
> function 
> in 
> which 
> the 
> program 
> stopped.
> 
> If 
> you 
> give 
> the 
> "up" 
> command, 
> gdb 
> will 
> construct 
> the 
> next
> (one) 
> stack 
> frame.
> 
> If 
> you 
> ask 
> for 
> "backtrace 
> 10" 
> it 
> will 
> construct 
> the 
> next
> ten 
> stack 
> frames.  
> And 
> if 
> you 
> ask 
> for 
> a 
> full 
> backtrace, 
> gdb 
> will 
> construct 
> as 
> many 
> stack 
> frames 
> as 
> it 
> can 
> find.
> 
> > 
> > 
> I 
> am 
> not 
> sure 
> but 
> i 
> think 
> to 
> creat 
> a 
> frame 
> it 
> calls 
> _initialize_stack 
> (void)
> 
> No.  
> That 
> function 
> is 
> the 
> initializer 
> for 
> the 
> "stack.c" 
> module.
> It 
> is 
> called 
> when 
> gdb 
> starts 
> up, 
> and 
> just 
> initializes 
> the 
> infrastructure 
> for 
> stack 
> manipulation.
> 
> >  
> and 
> from 
> this 
> it 
> calls 
> fun_command(char 
> *arg, 
> int 
> from_tty) 
> then 
> parse_frame_specification(char 
> *frame_exp) 
> & 
> then 
> create_new_frame(CORE_ADDR 
> addr, 
> CORE_ADDR 
> pc) 
> function.
> 
> Start 
> with 
> the 
> function 
> "get_prev_frame", 
> and 
> work 
> your 
> way 
> up 
> (and
> down) 
> from 
> there.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ----- Original Message ----
> > srinivas
> > 
> bakki
> > 
> wrote:
> > >
> > 
> Hi
> > 
> people,
> > > 
> > 
> I
> > 
> wanted
> > 
> to
> > 
> start
> > 
> going
> > 
> through
> > 
> the
> > 
> GDB
> > >
> > 
> source
> > 
> code
> > 
> to
> > 
> learn
> > 
> how
> > 
> it
> > 
> is
> > 
> implemented,
> > 
> what
> > 
> goes
> > >
> > 
> into
> > 
> the
> > 
> application
> > 
> and
> > 
> its
> > 
> various
> > 
> nuances,
> > 
> perhaps
> > >
> > 
> in
> > 
> a
> > 
> direction
> > 
> to
> > 
> be
> > 
> an
> > 
> active
> > 
> contributor
> > 
> to
> > 
> gdb.
> > > 
> > >
> > 
> But
> > 
> am
> > 
> not
> > 
> able
> > 
> to
> > 
> get
> > 
> a
> > 
> clue
> > 
> for
> > 
> the
> > 
> starting
> > 
> point.
> > >
> > 
> where
> > 
> should
> > 
> i
> > 
> start
> > 
> digging
> > 
> the
> > 
> code
> > 
> ?
> > > 
> > >
> > 
> Would
> > 
> be
> > 
> great
> > 
> if
> > 
> you
> > 
> people
> > 
> help
> > 
> me
> > 
> through
> > 
> this.
> > 
> > man
> > 
> ptrace
> > 
> > You
> > 
> should
> > 
> have
> > 
> a
> > 
> good
> > 
> understanding
> > 
> of
> > 
> how
> > 
> the
> > 
> unix
> > process
> > 
> works
> > 
> first.
> > 
> 
> 
> 
> 
>      
>
____________________________________________________________________________________
> Looking for last minute shopping deals?  
> Find them fast with Yahoo! Search. 
>
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
> 



      ___________________________________________________________
Support the World Aids Awareness campaign this month with Yahoo! For Good http://uk.promotions.yahoo.com/forgood/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: beginner
  2008-01-31 11:55 beginner srinivas bakki
@ 2008-01-31 12:01 ` Russell Shaw
  0 siblings, 0 replies; 4+ messages in thread
From: Russell Shaw @ 2008-01-31 12:01 UTC (permalink / raw)
  Cc: gdb

srinivas bakki wrote:
> Hi people,
>           I wanted to start going through the GDB
> source code to learn how it is implemented, what goes
> into the application and its various nuances, perhaps
> in a direction to be an active contributor to gdb.
> 
> But am not able to get a clue for the starting point.
> where should i start digging the code ?
> 
> Would be great if you people help me through this.

man ptrace

You should have a good understanding of how the unix
process works first.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* beginner
@ 2008-01-31 11:55 srinivas bakki
  2008-01-31 12:01 ` beginner Russell Shaw
  0 siblings, 1 reply; 4+ messages in thread
From: srinivas bakki @ 2008-01-31 11:55 UTC (permalink / raw)
  To: gdb

Hi people,
          I wanted to start going through the GDB
source code to learn how it is implemented, what goes
into the application and its various nuances, perhaps
in a direction to be an active contributor to gdb.

But am not able to get a clue for the starting point.
where should i start digging the code ?

Would be great if you people help me through this.

Regards
Srinivas Bakki


      __________________________________________________________
Sent from Yahoo! Mail - a smarter inbox http://uk.mail.yahoo.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-02-01  3:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-31 15:28 beginner Arun Paneri
2008-02-01  3:33 ` beginner srinivas bakki
  -- strict thread matches above, loose matches on Subject: below --
2008-01-31 11:55 beginner srinivas bakki
2008-01-31 12:01 ` beginner Russell Shaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox