Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Using gdb for debugging
« previous next »
  • Print
Pages: [1] 2

Author Topic: Using gdb for debugging  (Read 7219 times)

Offline iPodFoo

  • Member
  • *
  • Posts: 221
  • Ya dig?
    • iPod Nano Rockbox Blog
Using gdb for debugging
« on: December 30, 2006, 04:13:48 PM »
Hi.

Id like to be able to use the gdb debugger but I cant find much on how to use it. Looking at the "help" didnt really explain how to do things.

Do I run the simulator, then press ctrl and c to break then type one of the keywords listed in help?

Any pointers would be much appreciated.

Thanks.

ps. Using Debian in VMWare on XP.
« Last Edit: December 30, 2006, 04:15:27 PM by iPodFoo »
Logged
Visit my blog at modprojects.blogspot.com for some iPod Nano goodies!

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: Using gdb for debugging
« Reply #1 on: December 30, 2006, 07:04:44 PM »
You noticed some reference cards in a later post, why shouldn't there one for gdb? A quick google search found this here: http://refcards.com/refcards/gdb/index.html ("man gdb" might also be a start).
You can also have a look in the official gdb documentation at the gnu website: http://www.gnu.org/software/gdb/documentation/
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

Offline iPodFoo

  • Member
  • *
  • Posts: 221
  • Ya dig?
    • iPod Nano Rockbox Blog
Re: Using gdb for debugging
« Reply #2 on: December 30, 2006, 07:15:10 PM »
I only really stumbled on that reference cards page, unfortunately there wasnt a gdb one.

Will add those ones you found to the list. Thanks.

Is there a wiki page on gdb somewhere? If not and if I learn it right, I'll do one. ;D
« Last Edit: December 30, 2006, 07:29:12 PM by iPodFoo »
Logged
Visit my blog at modprojects.blogspot.com for some iPod Nano goodies!

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: Using gdb for debugging
« Reply #3 on: December 31, 2006, 04:15:16 AM »
AFAIK there isn't a wiki page on gdb yet (assuming you're speaking of the Rockbox wiki ;-)

Btw, why don't you add the reference card links to some getting started with development wiki page? Would make much more sense for me.
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Using gdb for debugging
« Reply #4 on: December 31, 2006, 04:17:50 AM »
Yes, we use the forums for discussion, and the wiki for static information.
Logged

Offline rkostynu

  • Member
  • *
  • Posts: 3
Re: Using gdb for debugging
« Reply #5 on: January 09, 2007, 08:43:50 PM »

here is a link I found:

http://users.actcom.co.il/~choo/lupg/tutorials/debugging/debugging-with-gdb.html

I'm kind of in the same boat with learning, so debugger is the best way to jump into the fire..

I create engineering applications using C# in .Net and Java, been a few years since Ive used C++ since C# came along, and never used C (maybe in highschool, 20 years ago). C isn't that hard to learn, esp. if you've been exposed to C++.

What I did was start with all the header files , printed most of the common ones out , started with main.c to get a list  to start with ( config.h, , etc...) and just start reading...

...get a handle on all the preprocessors, whats in, whats out and why.

..then scan all the header files to see what the function prototypes look like

im just going to teach myself gdb, so if i come across any other tuts ill let you know...

when your used to Visual Studio and graphical IDE's, its a bit of work, but at least im working my typing skills

Logged

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Using gdb for debugging
« Reply #6 on: January 10, 2007, 04:03:29 AM »
You could always use one of the many nice front ends for gdb. I quite like 'ddd' the Data Display Debugger - which puts a nice gui over the top of gdb.
Logged

Read The Manual Please

Offline iPodFoo

  • Member
  • *
  • Posts: 221
  • Ya dig?
    • iPod Nano Rockbox Blog
Re: Using gdb for debugging
« Reply #7 on: January 11, 2007, 04:45:45 PM »
That ddd looks interesting godeater. Problem is how can i install it?

Ive tried
Code: [Select]
dpkg -i ddd_3.3.11-1_i386.deb
but says theres dependency problems. So I tried
Code: [Select]
apt-get -f install
Still wont get the dependent files. They are:

Code: [Select]
debian:/home/user# apt-get -f install
Reading Package Lists... Done
Building Dependency Tree... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
  ddd: Depends: libgcc1 (>= 1:4.0.0-7) but 1:3.4.3-13 is installed
       Depends: libncurses5 (>= 5.4-5) but 5.4-4 is installed
       Depends: libstdc++6 (>= 4.0.0-10) but it is not installed
E: Unmet dependencies. Try using -f.
debian:/home/user#

Currently using the Debian package provided by rockbox. Tried looking at debian related forums but just recommend what I tried.  :-\
Logged
Visit my blog at modprojects.blogspot.com for some iPod Nano goodies!

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Using gdb for debugging
« Reply #8 on: January 12, 2007, 03:38:20 AM »
Unfortunately for you, I'm not a debian expert.

However, I probably wouldn't have started that with the "dpkg -i" - I'd just have done an "apt-get install ddd".

I'm not sure what having done it with dpkg has done to your package database - so I've no idea how to fix it - sorry :(

It looks like you need to upgrade the versions of libgcc and libncurses5 you have installed to the ones it says in the unmet dependencies section of that report. And you need to install libstdc++ too. I'm guessing that the reason their not currently installed is that their in the testing branch of debian, and not stable - but that's a completely wild stab in the dark - I could be utterly wrong.

You could always drop into IRC and ask nicely for the image maintainer to install ddd and replace the default image with the new one I suppose  :-\
Logged

Read The Manual Please

Offline scorche

  • Administrator
  • Member
  • *
  • Posts: 666
Re: Using gdb for debugging
« Reply #9 on: January 12, 2007, 03:43:34 AM »
There is no "image maintainer", but I did update the image last.

Download the new image and try it.  (And tell me if the image works as well.  I have not gotten a response if the new one works on a computer other than mine yet.  Networking would be the thing that would break if I had done something incorrectly.)
« Last Edit: January 12, 2007, 04:39:39 AM by scorche »
Logged

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Using gdb for debugging
« Reply #10 on: January 12, 2007, 04:26:34 AM »
I just tried it myself in the VMWare image (running it on Gentoo - but that shouldn't make any difference).

"apt-get install ddd" worked perfectly, and then running "ddd" itself also worked fine.
Logged

Read The Manual Please

Offline iPodFoo

  • Member
  • *
  • Posts: 221
  • Ya dig?
    • iPod Nano Rockbox Blog
Re: Using gdb for debugging
« Reply #11 on: January 12, 2007, 06:37:21 AM »
Seems I probably need to update vmware and debian image.

Can I just install them "on top" or would it be better to start from scratch by uninstalling the old ones and re-install with new versions?
Logged
Visit my blog at modprojects.blogspot.com for some iPod Nano goodies!

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Using gdb for debugging
« Reply #12 on: January 12, 2007, 07:34:15 AM »
I don't think you'll need to update Vmware - just download the new image, and replace your old one.

That'll only present a real hassle if you've patched your code tree a LOT.

If you *have* done that - make sure you get a nice diff across the whole tree and then save it to your host OS so you can transfer it back in to the source tree you check out with the new image.
Logged

Read The Manual Please

Offline iPodFoo

  • Member
  • *
  • Posts: 221
  • Ya dig?
    • iPod Nano Rockbox Blog
Re: Using gdb for debugging
« Reply #13 on: January 12, 2007, 09:53:49 AM »
Managed to install ddd after installing new version of vmware and debian so thats all sweet now. Only i cant seem to install fontforge now :-\

Code: [Select]
debian:/home/user# apt-get install fontforge
Reading Package Lists... Done
Building Dependency Tree... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  fontforge: Depends: libice6 (>= 1:1.0.0) but 4.3.0.dfsg.1-14sarge1 is to be installed
E: Broken packages
debian:/home/user#
Logged
Visit my blog at modprojects.blogspot.com for some iPod Nano goodies!

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Using gdb for debugging
« Reply #14 on: January 12, 2007, 10:07:11 AM »
Is that after the appropriate "apt-get update" too ?
Logged

Read The Manual Please

  • Print
Pages: [1] 2
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Using gdb for debugging
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.104 seconds with 14 queries.