comp.lang.ada
 help / color / mirror / Atom feed
* XMLAda and GDB on Lion anybody?
@ 2011-08-04  7:54 MRE
  2011-08-04 12:04 ` Simon Wright
  2011-08-06 17:26 ` Simon Wright
  0 siblings, 2 replies; 5+ messages in thread
From: MRE @ 2011-08-04  7:54 UTC (permalink / raw)


Hi all,

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?

Best regards,

Marc



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: XMLAda and GDB on Lion anybody?
  2011-08-04  7:54 XMLAda and GDB on Lion anybody? MRE
@ 2011-08-04 12:04 ` Simon Wright
  2011-08-06 17:25   ` Simon Wright
  2011-08-06 17:26 ` Simon Wright
  1 sibling, 1 reply; 5+ messages in thread
From: Simon Wright @ 2011-08-04 12:04 UTC (permalink / raw)


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) 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: XMLAda and GDB on Lion anybody?
  2011-08-04 12:04 ` Simon Wright
@ 2011-08-06 17:25   ` Simon Wright
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Wright @ 2011-08-06 17:25 UTC (permalink / raw)


I wrote a couple of notes on this at
http://forward-in-code.blogspot.com/



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: XMLAda and GDB on Lion anybody?
  2011-08-04  7:54 XMLAda and GDB on Lion anybody? MRE
  2011-08-04 12:04 ` Simon Wright
@ 2011-08-06 17:26 ` Simon Wright
  2011-08-18  7:22   ` MRE
  1 sibling, 1 reply; 5+ messages in thread
From: Simon Wright @ 2011-08-06 17:26 UTC (permalink / raw)


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

How have you got on?



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: XMLAda and GDB on Lion anybody?
  2011-08-06 17:26 ` Simon Wright
@ 2011-08-18  7:22   ` MRE
  0 siblings, 0 replies; 5+ messages in thread
From: MRE @ 2011-08-18  7:22 UTC (permalink / raw)


On 6 Aug., 19:26, Simon Wright <si...@pushface.org> wrote:
> MRE <Marc.Enzm...@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
>
> How have you got on?

Hi all! Thanks for the quick and very helpful response.

My first problem got solved rather easily. Almost embarassing, I
played with the example and forgot to
put the commands back in the right order, so I tried to access a
structure I had freed earslier.

Regarding the GDB, adding "-Wl,-no_pie" to the Linker-Section in the
project file helped.

Thanks again!

Regards,

Marc



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-08-18  7:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-04  7:54 XMLAda and GDB on Lion anybody? MRE
2011-08-04 12:04 ` Simon Wright
2011-08-06 17:25   ` Simon Wright
2011-08-06 17:26 ` Simon Wright
2011-08-18  7:22   ` MRE

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