LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-16-2011, 03:16 AM   #1
atulmt
LQ Newbie
 
Registered: Aug 2011
Posts: 6

Rep: Reputation: Disabled
GDB server code


hi,
for some project work i need to understand the working of remote debugging and the gdb server code. can some one help me to find the design and code of gdb server??

Thanks
 
Old 08-16-2011, 03:37 AM   #2
kakaka
Member
 
Registered: Sep 2003
Posts: 382

Rep: Reputation: 87
Have you downloaded the source code for GDB from gnu.org, or other sites mentioned on gnu.org, such as redhat's mirrors where you can find versions of the GDB source code, here for example

http://sources-redhat.mirrors.airband.net/gdb/releases/

and have you explored documentation such as

http://sourceware.org/gdb/current/onlinedocs/gdbint/

which is supposed to be a description of GDB internals, and you are now saying that none of that allows you to do what you need?
 
Old 08-16-2011, 04:23 AM   #3
atulmt
LQ Newbie
 
Registered: Aug 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
thanks,
i have just started but didn't know from where to start.
 
Old 08-18-2011, 02:35 AM   #4
atulmt
LQ Newbie
 
Registered: Aug 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
I have downloaded the GDB code. Can someone provide links to more documentation on it especially the implementation of the remote server.

Thanks
 
Old 09-03-2011, 06:10 PM   #5
kakaka
Member
 
Registered: Sep 2003
Posts: 382

Rep: Reputation: 87
Sorry for the delayed response.

Since it's been more than a couple weeks, I'd guess you've probably
already found the information you need. I'm responding, just in case
you haven't found the info.

Although I'm not sure I have enough details on what you need, to really
be helpful, so I'll just try to give an overview of what I'm aware.

I get the software for my region, the State of Illinois, in the
United States, by visiting http://www.gnu.org/ then clicking on
Downloads from the menu bar below the main title on the main
page. From the page that link brings up, I find the link labeled
"Download it from the web or via FTP" and click on it.
On the new page I go through the mirrors for Illinois,
grab the first one that's "http", I happen to find it
convenient and fairly reliable to download through the browser
I'm using.

That link is http://mirror.team-cymru.org/gnu/

I mention the specific link, because, although in an ideal World,
the mirrors would have identical content, in real life, the content
of mirrors can vary. If your results don't match mine, one
possible cause of the problem could be if we downloaded from
different places.

I use the browser's facility to search for text within a page, to quickly
find gdb within that page, click on gdb, pop down to the bottom of the
page that link brings up, where I find files of different formats, containing
the newest "official" release.

I happen to like bzip2, so I download gdb-7.3a.tar.bz2, which contains
AFAIK, the latest official release.

You could at this point try to check the "Sig" of the file, but that
raises a whole collection of issues regarding so called "Security".
Whether or not security can be bypassed, and whether or not anyone who
did, who knew what they were doing, would make the .sig file be
consistent with the tar file, even if they were both faked. Then
too, after all it, it is source, and you could always check the code
to see if it made sense, or compare it against source downloaded from
other mirrors, etc. Naturally if the checksums of what's supposed
to be the same file from two servers, match, you need compare no
further.

I place the tar into a directory I've created to build gdb and
get the files out of the tar, making a log of that procedure
like so:

tar xjvf gdb-7.3a.tar.bz2 > gdb-7.3a.untar.log 2>&1

I check the log for errors. There are none. I change to the
build directory created by un-tar-ing the files.

cd *3

Glancing at the main README file there, gives me info on how to build
gdb.

From that, for safety sake, I build gdb with these commands which
seem appropriate, since I'm using the bash shell:

CC=gcc ./configure

Since I saw no errors I continue with:

CC=gcc make

Again, there are no errors. I'm pleased because some earlier releases
needed to be modified to build without errors.

From the build directory, there is a path gdb/gdbserver in which
the gdbserver executable is built. There is a man page for gdbserver
there. In my Linux environment, if I don't wish to install the files
I've built,

I can directly view the man page like this:

man -l gdb/gdbserver/gdbserver.1

and the full .info file for gdb, including information on remote
debugging
, can be viewed with this command:

info -f gdb/doc/gdb.info

You have the URL for one of the main documents on gdb internals:

http://sourceware.org/gdb/current/onlinedocs/gdbint/

There are various documents about gdb on the Web, tutorials,
mentions of the protocol that is used between the local and remote
programs for remote debugging, etc. But all taken together, I
don't know that they really give you any more meaningful information
than you can find in the documents that have already been
specifically mentioned.

I'm not aware of any document readily available on the Web that's
just about the design of gdbserver. Of course the Web is very large
and a design document may still be out there somewhere.

As far as searching for a document specifically on the design of
gdbserver, I've been developing software and dealing with
Internetworking concepts, both for dozens of years, since the days
when what we had was called USENET, which essentially grew into
what was known by billions of people as the Internet, and more
recently the Web. I've tried dozens of Search Engines. Although, AFAIK
Wolfram Alpha is purported to use some sophisticated algorithm, I've
tested other engines against the version of Wolfram that was live when
I tested, and my feeling is that Startpage and Bing tend to produce the
best results.

But with differences in the way various engines acquire and index data,
it can be worthwhile trying different engines and different keywords.
I've used a variety of engines and keywords to search for a design
document specifically on gdbserver, since your questions got me
interested in it, and I haven't found such a document. But you may
have better luck.

Without a specific gdbserver design document, depending on what
exactly you're trying to accomplish, you might be able to proceed
by looking at the source code that is *specific* to gdbserver in the
gdb/gdbserver directory.

If it would be more helpful to start with something of a model, and
you are familiar with UML, several UML tools that can be pointed at
source code and will "Reverse Engineer"/generate a UML model from the
existing source code, are listed here:

https://secure.wikimedia.org/wikiped...Language_tools

Although Web searches find other free UML tools which can generate UML
models from source code, I've always thought the Wiki page was nice,
because it lists several tools in one place, especially multiple
Open Source tools.

Finally, I could be confused, but my recollection was that gdbserver
was effectively almost a general purpose "stub" for remote debugging,
rather than requiring people to create their own stubs specific to a
particular purpose. So focusing on information about how to design a
stub might be relevant to understanding the design of gdbserver.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cygwin gcc compiled code generates a stackdump - How to analyze with Gdb madsovenielsen Programming 3 04-13-2011 05:18 AM
[SOLVED] GDB doesn't provide the correct line in the source code napx Programming 3 01-23-2011 08:16 PM
setting up a GDB server under DDD knobby67 Programming 0 10-18-2010 05:53 AM
code line in gdb kshkid Programming 4 06-12-2008 03:06 AM
normal gdb and spec gdb for kgdb Igor007 Linux - Newbie 1 09-23-2005 02:41 PM


All times are GMT -5. The time now is 10:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration