users-prolog
[Top][All Lists]
Advanced

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

Re: gprolog 1.2.8 on MacOS X


From: Jacques Menu
Subject: Re: gprolog 1.2.8 on MacOS X
Date: Sun, 25 Nov 2001 23:10:07 +0100

Hello Daniel,

Here is what I get with gdb when trying to debug 'check' :

---

macjmi jacques - /Users/jacques/Documents/GNU_Prolog/gprolog-1.2.8/src/Ma2Asm > gdb check GNU gdb 5.0-20001113 (Apple version gdb-200) (Mon Sep 3 02:43:52 GMT 2001) (UI_OUT)
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "powerpc-apple-macos10".
Reading symbols for shared libraries .. done
(gdb) break ma_test_ret
Breakpoint 1 at 0x3c38
(gdb) run
Starting program: /Users/jacques/Documents/GNU_Prolog/gprolog-1.2.8/src/Ma2Asm/check
[Switching to thread 1 (process 712 thread 0x1603)]
reg_bank=&X(0): 0xad80   B: 0xb310   E:0xc310  &Y(0): 0xc300
stack: 0xad80
test 1: long local/global ...
test 1  OK
test 2: pl_jump/pl_ret...

Breakpoint 1, 0x00003c38 in ma_test_ret ()
(gdb) step
Single stepping until exit from function ma_test_ret,
which has no line number information.

Program received signal EXC_BAD_ACCESS, Could not access memory.
0x00003c38 in ma_test_ret ()
(gdb)

---

The error occurs right at ma_test_ret. Aligning to .align 4 or 8 doesn't change this behaviour.

The source code follows, and the problem seems to be that r15 is not initialized or contains garbage.
Or maybe I should force MAP_REG_BANK to be defined in code such as :

void
Asm_Start(void)
{
#ifdef MAP_REG_BANK
  sprintf(asm_reg_bank, "%s", MAP_REG_BANK);
#else
  strcpy(asm_reg_bank, "15");
#endif

I don't know enough of GNU Prolog 1.2.8 internals, in particular about MAP_REG_BANK and the like, to decide by myself.
Any help is welcome !

Regards,

---

.text

_fail:
        lwz     r9,1028(r15)
        lwz     r9,-4(r9)
        mtctr   r9
        bctr

        .align  2
        ;       .type   _ma_test_pl_jump_and_pl_ret,@function
        .globl  _ma_test_pl_jump_and_pl_ret

_ma_test_pl_jump_and_pl_ret:
        b       _ma_test_ret

        .align  2
        ;       .type   _ma_test_ret,@function
        .globl  _ma_test_ret

_ma_test_ret:
        lwz     r0,1040(r15)
        mtctr   r0
        bctr

        .align  2
        ;       .type   _ma_test_pl_call_and_pl_ret_and_pl_fail,@function
        .globl  _ma_test_pl_call_and_pl_ret_and_pl_fail




reply via email to

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