[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A beginner's question

From: john o goyo
Subject: Re: A beginner's question
Date: Thu, 20 Apr 2023 13:33:07 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.10.0

Greetings, Rudolf.

Further to the suggestion from Gaius (below), I find ddd+gdb to be very useful.  Depending on your system, ddd may be available in some repository.


On 2023-04-20 11:18, Gaius Mulley wrote:
Hi Rudolf,

I use gdb to debug modula-2.  I also use gm2 with -g -O0 to generate
accurate line numbers etc.
Occasionally I find it useful to compile the whole project and get
good debugging inside the libraries via:

$ gm2 -g -O0 -fm2-whole-program -fiso mainmodule.mod
$ gdb a.out

(but perhaps it might be better to start without the
-fm2-whole-program and see if that is enough).
Exported procedure names are transformed into modulename_procedurename
whereas local procedures are without the module prefix.   When using
gdb it is also useful to use the ^x^a
(toggle) which splits the screen with source code in the top half.

I have some extra gdb enhancements - which I'm still working on (which
handle unbounded arrays).
I'll try and expedite these changes and post them to the gdb mailing
list - currently some regressions fail.

hope this helps,

On Thu, Apr 20, 2023 at 10:53 AM Rudolf Schubert <> wrote:
Hi Gaius,

I quickly tested the patch and could verify that all my *mod files
including squash_bug[123].mod now compile successfully as you write!
Thank you very much for your (quick and successful) efforts!

One 'small' remaining problem now is: I do not have a real clue as
how to track down the bugs which the three 'bug files' still exhibit
when run. Till now I just entered some 'printfs' for debugging. Would
you think that a 'real debugger' might help here? I.e. that I would try
to see what's happening at register or assembler level? I'm not sure,
however how quickly I would proceed here;-)



Rudolf Schubert                 \
Kirchstr. 18a                    \
82054 Sauerlach                   >
Deutschland                      /
Tel. 08104/908311               /

On Thu, 20 Apr 2023, Gaius Mulley wrote:

Hi Rudolf,

many thanks for your email and test code - all very helpful.   Here is
a bug fix for the latest gcc git.
When applied I see squash_bug[123].mod all compile successfully.

The constructor was not being placed onto the preserve list within cc1gm2.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]