comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: XMLAda and GDB on Lion anybody?
Date: Thu, 04 Aug 2011 13:04:21 +0100
Date: 2011-08-04T13:04:21+01:00	[thread overview]
Message-ID: <m27h6t4c3e.fsf@pushface.org> (raw)
In-Reply-To: f0eb1c6b-48b1-4a6a-8beb-6d7775d881f4@w27g2000yqk.googlegroups.com

MRE <Marc.Enzmann@web.de> writes:

> I am experimenting with XMLAda, following AdaCore's manual.
>
> When running the example given on pages 22 and 23 (DomExample2), I get
> the following exception:
>
> raised CONSTRAINT_ERROR : dom-core-nodes.adb:237 access check failed
>
> as soon as the line
>
> List := Get_Elements_By_Tag_Name (Doc, "pref");
>
> is reached.
>
> I have not really an idea what the problem might be, as I can't debug
> properly, GDB telling me
>
> unable to read unknown load command 0x24
> unable to read unknown load command 0x26
>
> Is it just me, or has anybody else seen this too?

When I run the example (with no changes, using GNAT GPL 2011) it works
just fine :-).

However, (a) it's much better to debug using static libraries, (b) Lion
has made a sgnificant change to linking an executable, in that the
default behaviour is now to create position-independent executables
which can be loaded into store at random addresses to defeat malware.

I find I can run domexample2 under the debugger (including the ability
to set catchpoints for exceptions and breakpoints) by

   $ gnatmake -P default domexample2.adb -g -XLIBRARY_TYPE=static \
      -largs -Wl,-no_pie

This still gives the warnings about load commands...

$ gdb domexample2
GNU gdb (GDB) 7.2 for GNAT GPL 2011 (20110419) [rev=gdb-7.2-ref-110-g8cd875d]
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
See your support agreement for details of warranty and support.
If you do not have a current support agreement, then there is absolutely
no warranty for this version of GDB.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin10.2.0".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
unable to read unknown load command 0x24
unable to read unknown load command 0x26
unable to read unknown load command 0x24
unable to read unknown load command 0x26
Reading symbols from /Users/simon/xmlada-4.1-src/docs/dom/domexample2...
warning: can't find section '*UND*' in OSO file /Users/simon/xmlada-4.1-src/sax/lib/static/libxmlada_sax.a(sax-encodings.o)
done.
(gdb) b exception
Catchpoint 1: all Ada exceptions
(gdb) b domexample2.adb:30
Breakpoint 2 at 0x1000018ca: file /Users/simon/xmlada-4.1-src/docs/dom/domexample2.adb, line 30.
(gdb) run
Starting program: /Users/simon/xmlada-4.1-src/docs/dom/domexample2 
unable to read unknown load command 0x24
unable to read unknown load command 0x26

Breakpoint 2, domexample2 ()
    at /Users/simon/xmlada-4.1-src/docs/dom/domexample2.adb:30
30	   List := Get_Elements_By_Tag_Name (Doc, "pref");
(gdb) b dom-core-nodes.adb:237
Breakpoint 3 at 0x100007ca1: file /Users/simon/xmlada-4.1-src/dom/dom-core-nodes.adb, line 237.
(gdb) c
Continuing.

Breakpoint 3, dom.core.nodes.child_nodes (n=0x100200c50)
    at /Users/simon/xmlada-4.1-src/dom/dom-core-nodes.adb:237
237	      case N.Node_Type is
(gdb) c
Continuing.

Breakpoint 3, dom.core.nodes.child_nodes (n=0x100200d50)
    at /Users/simon/xmlada-4.1-src/dom/dom-core-nodes.adb:237
237	      case N.Node_Type is
(gdb) c
Continuing.

Breakpoint 3, dom.core.nodes.child_nodes (n=0x100200df0)
    at /Users/simon/xmlada-4.1-src/dom/dom-core-nodes.adb:237
237	      case N.Node_Type is
(gdb) del 3
(gdb) c
Continuing.
Value of "pref1" is Value1
Value of "pref2" is Value2

Program exited normally.
(gdb) 



  reply	other threads:[~2011-08-04 12:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-04  7:54 XMLAda and GDB on Lion anybody? MRE
2011-08-04 12:04 ` Simon Wright [this message]
2011-08-06 17:25   ` Simon Wright
2011-08-06 17:26 ` Simon Wright
2011-08-18  7:22   ` MRE
replies disabled

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