Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » SDCC
  • » [Sdcc-user] Visual debugging of '51 under Windows - first steps [RSS Feed]

#1 June 10, 2010 18:56:00

Jan W.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Sdcc-user] Visual debugging of '51 under Windows - first steps


The SDCC manual chapter 5.1.6 inidicates, that the ddd visual debugger
front-end can be used with sdcdb/s51 to debug visually sdcc-x51 programs.
However, ddd is *nux-only, as it is bound to X-Window. Recently, X-Windows have
been added to Cygwin, and that opened a new opportunity. I'd try to go through
all the obstacles and succeeded to run ddd with sdcdb on a Windows Vista SP2
machine. Don't be overly optimistic, though, this is a rather cumbersome and
heavyweight path. See also the caution below at item 4.
Here are the details:

1. Install SDCC "normally", making sure the appropriate paths to sdcc binaries
are set to the command line environment. Create some working directory, write
some simple program (I simply copied /device/examples/mcs51/simple/hi.c
to my working directory) and compile it with the --debug switch (sdcc --debug
hi.c).

2. Install Cygwin/X. The hints are inhttp://x.cygwin.com/docs/ug/setup-cygwin-x-installing.html. Basically, run a
"normal" Cygwin installation, and make sure you select xorg-server and xinit in
the installator (its response to wild clicking is rather slow, be patient).
Don't proceed yet with Cygwin, goto item 3. below... :-)

3. ... in the same installator, select to install also ddd . It will select
some required libraries automagically.

4. Proceed with the installation. CAUTION. Don't even attempt this without
access to fast and unlimited internet connection and enough free disk space.
For me, it downloaded more than 1.3GByte data, and the resulting cygwin
directory is almost 5Gbytes. It surely can be tuned up: the installator pulls a
lot of unnecessary applications and their libraries and kin; but I simply
cannot tell what is needed from it and what is not.

5. Wait. For me, it took another two hours after the download until the
installator did everything it wanted to do. Don't be surprised if it installs
some garbage icons on the desktop as it was for me :-( but at least the Start
menu contained (among others) the Cygwin-X directory.

6. From Start menu, run Cygwin-X. Wait. It creates an "X" icon in the right
icon tray, and, after more waiting, it opens a window with the shell. At this
point, some rudimentary experience with *nux or at least with command line
tools is needed. Note, that the root directory inside Cygwin is equal to Win
directory where Cygwin was installed, typically C:\cygwin. So we are now in our
$HOME directory, which in Cygwin is /home/, in Win it is
C:\\home\. To break out from cygwin to the Win directory
system, cygwin provides a /cygdrive "directory" containing all the Win drives.
So, a C:\Programs\SDCC Win directory is /cygdrive/c/Programs/SDCC in Cygwin.
Try to go up and down on the directory structure in Cygwin using the cd and ls
commands to get a grip of what is happening.

7. As sdcdb runs as a Win application and ddd as a Cygwin one, they see the
directory structure differently. This different notion of paths makes
unpractical to try to run if from anywhere else than from the working
directory, where we have all the sources and files resulting from compilation
at one place with no need to go elsewhere in the directory structure (to
understand this took me quite some time and experimentation... ;-) ). So, if
your working directory from item 1 was say C:\Work, in the Cygwin/X window do
cd /cygdrive/c/Work.

8. A happy moment:
ddd -debugger "sdcdb hi"
("hi" here is the name of your program but with no file extension - mine was
hi.c)
Wait. Wait. Wait.
Voila!

9. It has its limitations, of course. Source code and disassembly display and
breakpoints and run/step work (mostly). Could display registers but not memory.
The fonts are ugly and some windows can't be resized so you need to scroll
up/down or left/right to see everything. Don't know how to redirect IO. Some
commands make the whole stuff crash; the aftermath is that you need to inspect
in TaskManager within processes if s51 (and sdcdb itself) are not still running
and if yes, kill them manually.

First steps, but maybe there will be more.

Jan Waclawek






Sdcc-user mailing list
Sdcc-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/sdcc-user

Offline

#2 June 12, 2010 10:46:46

Borut R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Sdcc-user] Visual debugging of '51 under Windows - first steps


Jan,

you could put this on the SDCC wiki...

Borut



On 06/10/2010 07:53 PM, Jan Waclawek wrote:
> The SDCC manual chapter 5.1.6 inidicates, that the ddd visual debugger
> front-end can be used with sdcdb/s51 to debug visually sdcc-x51 programs.
> However, ddd is *nux-only, as it is bound to X-Window. Recently, X-Windows
> have been added to Cygwin, and that opened a new opportunity. I'd try to go
> through all the obstacles and succeeded to run ddd with sdcdb on a Windows
> Vista SP2 machine. Don't be overly optimistic, though, this is a rather
> cumbersome and heavyweight path. See also the caution below at item 4.
> Here are the details:
>
> 1. Install SDCC "normally", making sure the appropriate paths to sdcc
> binaries are set to the command line environment. Create some working
> directory, write some simple program (I simply copied
> /device/examples/mcs51/simple/hi.c to my working directory) and compile
> it with the --debug switch (sdcc --debug hi.c).
>
> 2. Install Cygwin/X. The hints are in
>http://x.cygwin.com/docs/ug/setup-cygwin-x-installing.html. Basically, run a
> "normal" Cygwin installation, and make sure you select xorg-server and xinit
> in the installator (its response to wild clicking is rather slow, be
> patient). Don't proceed yet with Cygwin, goto item 3. below... :-)
>
> 3. ... in the same installator, select to install also ddd . It will select
> some required libraries automagically.
>
> 4. Proceed with the installation. CAUTION. Don't even attempt this without
> access to fast and unlimited internet connection and enough free disk space.
> For me, it downloaded more than 1.3GByte data, and the resulting cygwin
> directory is almost 5Gbytes. It surely can be tuned up: the installator pulls
> a lot of unnecessary applications and their libraries and kin; but I simply
> cannot tell what is needed from it and what is not.
>
> 5. Wait. For me, it took another two hours after the download until the
> installator did everything it wanted to do. Don't be surprised if it installs
> some garbage icons on the desktop as it was for me :-( but at least the Start
> menu contained (among others) the Cygwin-X directory.
>
> 6. From Start menu, run Cygwin-X. Wait. It creates an "X" icon in the right
> icon tray, and, after more waiting, it opens a window with the shell. At this
> point, some rudimentary experience with *nux or at least with command line
> tools is needed. Note, that the root directory inside Cygwin is equal to Win
> directory where Cygwin was installed, typically C:\cygwin. So we are now in
> our $HOME directory, which in Cygwin is /home/, in Win it is
> C:\\home\. To break out from cygwin to the Win directory
> system, cygwin provides a /cygdrive "directory" containing all the Win
> drives. So, a C:\Programs\SDCC Win directory is /cygdrive/c/Programs/SDCC in
> Cygwin. Try to go up and down on the directory structure in Cygwin using the
> cd and ls commands to get a grip of what is happening.
>
> 7. As sdcdb runs as a Win application and ddd as a Cygwin one, they see the
> directory structure differently. This different notion of paths makes
> unpractical to try to run if from anywhere else than from the working
> directory, where we have all the sources and files resulting from compilation
> at one place with no need to go elsewhere in the directory structure (to
> understand this took me quite some time and experimentation... ;-) ). So, if
> your working directory from item 1 was say C:\Work, in the Cygwin/X window do
> cd /cygdrive/c/Work.
>
> 8. A happy moment:
> ddd -debugger "sdcdb hi"
> ("hi" here is the name of your program but with no file extension - mine was
> hi.c)
> Wait. Wait. Wait.
> Voila!
>
> 9. It has its limitations, of course. Source code and disassembly display and
> breakpoints and run/step work (mostly). Could display registers but not
> memory. The fonts are ugly and some windows can't be resized so you need to
> scroll up/down or left/right to see everything. Don't know how to redirect
> IO. Some commands make the whole stuff crash; the aftermath is that you need
> to inspect in TaskManager within processes if s51 (and sdcdb itself) are not
> still running and if yes, kill them manually.
>
> First steps, but maybe there will be more.
>
> Jan Waclawek
>
>
>
>
>
>
> Sdcc-user mailing list
> Sdcc-u***@*ists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/sdcc-user>
>



Sdcc-user mailing list
Sdcc-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/sdcc-user

Offline

#3 June 20, 2010 12:12:58

Sébastien L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Sdcc-user] Visual debugging of '51 under Windows - first steps


Hi,

to save spacetime, XMing may be interesting:http://sourceforge.net/projects/xming/However, ddd does not seem to exist for mingw/msys, or I missed it :(

Regards
Sebastien

On Sat, Jun 12, 2010 at 6:44 PM, Borut Razem <borut.ra***@*iol.net> wrote:

> Jan,
>
> you could put this on the SDCC wiki...
>
> Borut
>
>
>
> On 06/10/2010 07:53 PM, Jan Waclawek wrote:
> > The SDCC manual chapter 5.1.6 inidicates, that the ddd visual debugger
> front-end can be used with sdcdb/s51 to debug visually sdcc-x51 programs.
> However, ddd is *nux-only, as it is bound to X-Window. Recently, X-Windows
> have been added to Cygwin, and that opened a new opportunity. I'd try to go
> through all the obstacles and succeeded to run ddd with sdcdb on a Windows
> Vista SP2 machine. Don't be overly optimistic, though, this is a rather
> cumbersome and heavyweight path. See also the caution below at item 4.
> > Here are the details:
> >
> > 1. Install SDCC "normally", making sure the appropriate paths to sdcc
> binaries are set to the command line environment. Create some working
> directory, write some simple program (I simply copied
> /device/examples/mcs51/simple/hi.c to my working directory) and
> compile it with the --debug switch (sdcc --debug hi.c).
> >
> > 2. Install Cygwin/X. The hints are in
>http://x.cygwin.com/docs/ug/setup-cygwin-x-installing.html. Basically,
> run a "normal" Cygwin installation, and make sure you select xorg-server and
> xinit in the installator (its response to wild clicking is rather slow, be
> patient). Don't proceed yet with Cygwin, goto item 3. below... :-)
> >
> > 3. ... in the same installator, select to install also ddd . It will
> select some required libraries automagically.
> >
> > 4. Proceed with the installation. CAUTION. Don't even attempt this
> without access to fast and unlimited internet connection and enough free
> disk space. For me, it downloaded more than 1.3GByte data, and the resulting
> cygwin directory is almost 5Gbytes. It surely can be tuned up: the
> installator pulls a lot of unnecessary applications and their libraries and
> kin; but I simply cannot tell what is needed from it and what is not.
> >
> > 5. Wait. For me, it took another two hours after the download until the
> installator did everything it wanted to do. Don't be surprised if it
> installs some garbage icons on the desktop as it was for me :-( but at least
> the Start menu contained (among others) the Cygwin-X directory.
> >
> > 6. From Start menu, run Cygwin-X. Wait. It creates an "X" icon in the
> right icon tray, and, after more waiting, it opens a window with the shell.
> At this point, some rudimentary experience with *nux or at least with
> command line tools is needed. Note, that the root directory inside Cygwin is
> equal to Win directory where Cygwin was installed, typically C:\cygwin. So
> we are now in our $HOME directory, which in Cygwin is /home/, in
> Win it is C:\\home\. To break out from cygwin to the Win
> directory system, cygwin provides a /cygdrive "directory" containing all the
> Win drives. So, a C:\Programs\SDCC Win directory is
> /cygdrive/c/Programs/SDCC in Cygwin. Try to go up and down on the directory
> structure in Cygwin using the cd and ls commands to get a grip of what is
> happening.
> >
> > 7. As sdcdb runs as a Win application and ddd as a Cygwin one, they see
> the directory structure differently. This different notion of paths makes
> unpractical to try to run if from anywhere else than from the working
> directory, where we have all the sources and files resulting from
> compilation at one place with no need to go elsewhere in the directory
> structure (to understand this took me quite some time and experimentation...
> ;-) ). So, if your working directory from item 1 was say C:\Work, in the
> Cygwin/X window do cd /cygdrive/c/Work.
> >
> > 8. A happy moment:
> > ddd -debugger "sdcdb hi"
> > ("hi" here is the name of your program but with no file extension - mine
> was hi.c)
> > Wait. Wait. Wait.
> > Voila!
> >
> > 9. It has its limitations, of course. Source code and disassembly display
> and breakpoints and run/step work (mostly). Could display registers but not
> memory. The fonts are ugly and some windows can't be resized so you need to
> scroll up/down or left/right to see everything. Don't know how to redirect
> IO. Some commands make the whole stuff crash; the aftermath is that you need
> to inspect in TaskManager within processes if s51 (and sdcdb itself) are not
> still running and if yes, kill them manually.
> >
> > First steps, but maybe there will be more.
> >
> > Jan Waclawek
> >
> >
> >
> >
> >
> >
>
> > Sdcc-user mailing list
> > Sdcc-u***@*ists.sourceforge.net
> >https://lists.sourceforge.net/lists/listinfo/sdcc-user> >
> >
>
>
>
>
> Sdcc-user mailing list
> Sdcc-u***@*ists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/sdcc-user>
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/sdcc-user

Offline

#4 June 20, 2010 22:44:18

Jan W.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Sdcc-user] Visual debugging of '51 under Windows - first steps


> to save spacetime, XMing may be interesting:http://sourceforge.net/projects/xming/Interesting indeed. Thanks.

> However, ddd does not seem to exist for mingw/msys, or I missed it :(

That's the point, unfortunately.
I am a pure dumb user and absolutely unable to build anything including ddd
on its native, not even on a different platform...

Jan




Sdcc-user mailing list
Sdcc-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/sdcc-user

Offline

  • Root
  • » SDCC
  • » [Sdcc-user] Visual debugging of '51 under Windows - first steps [RSS Feed]

Board footer

Moderator control

Enjoy the 15th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support