Re: GDB on AIX

Yao Qi <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAH=s-PO7wfR=HmxPwcSdkB8kA_=HrMkP3KfEWMA4mbXF4cs8ag@mail.gmail.com>
On Mon, Nov 14, 2016 at 05:18:31PM +0000, Pedro Alves wrote:
> On 11/14/2016 03:51 PM, Yao Qi wrote:
> > Hi David and Sergio,
> >
> > GDB mainline is broken on aix (gcc119.fsffrance.org),
>
>
> > (gdb) kill
> > terminate called after throwing an instance of 'gdb_exception_RETURN_MASK_ERROR'
> > IOT/Abort trap (core dumped)
>
> If you debug gdb and put a breakpoint on throw_it, what does the
> backtrace look like?  Would be exception be crossing
> some C library that doesn't understand C++ exceptions,
> other than readline?
>

I don't see any C library other than readline,

(top-gdb) bt
#0  _ZL8throw_it13return_reason6errorsPKcPc (reason=1, error=538192296,
    fmt=0x105cebcc <_GLOBAL__F_inferior_ptid+5836> "The program is not
being run.", ap=0x2ff2253c "/Ã")
    at ../../binutils-gdb/gdb/common/common-exceptions.c:345
#1  0x10031390 in _Z12throw_verror6errorsPKcPc (error=4294967295, fmt=0x1 "",
    ap=0x105cebcc <_GLOBAL__F_inferior_ptid+5836> "The program is not
being run.") at ../../binutils-gdb/gdb/common/common-exceptions.c:379
#2  0x1000f940 in _Z6verrorPKcPc (string=0xffffffff <error: Cannot
access memory at address 0xffffffff>, args=0x1 "")
    at ../../binutils-gdb/gdb/utils.c:477
#3  0x1002e6a4 in _Z5errorPKcz (fmt=0xffffffff <error: Cannot access
memory at address 0xffffffff>) at
../../binutils-gdb/gdb/common/errors.c:43
#4  0x100d9170 in _ZL12kill_commandPci (arg=0xffffffff <error: Cannot
access memory at address 0xffffffff>, from_tty=1)
    at ../../binutils-gdb/gdb/infcmd.c:2578
#5  0x1008b5c8 in _ZL8do_cfuncP16cmd_list_elementPci (c=0xffffffff,
args=0x1 "", from_tty=274525132) at
../../binutils-gdb/gdb/cli/cli-decode.c:105
#6  0x1008f478 in _Z8cmd_funcP16cmd_list_elementPci (cmd=0x20111d78,
args=0x0, from_tty=1) at ../../binutils-gdb/gdb/cli/cli-decode.c:1913
#7  0x10061298 in _Z15execute_commandPci (p=0x200a9798 "kill",
from_tty=1) at ../../binutils-gdb/gdb/top.c:80
#8  0x1002fed4 in _Z15command_handlerPc (command=0x200a9798 "kill") at
../../binutils-gdb/gdb/event-top.c:577
#9  0x1003033c in _Z20command_line_handlerPc (rl=0xffffffff <error:
Cannot access memory at address 0xffffffff>)
    at ../../binutils-gdb/gdb/event-top.c:25
#10 0x1002ea40 in _ZL23gdb_rl_callback_handlerPc (rl=0x200a99a8
"kill") at ../../binutils-gdb/gdb/event-top.c:200
#11 0x100320a8 in rl_callback_read_char () at
../../binutils-gdb/readline/callback.c:220
#12 0x1002e8f0 in _ZL33gdb_rl_callback_read_char_wrapperPv
(client_data=0xffffffff) at ../../binutils-gdb/gdb/event-top.c:173
#13 0x1002f540 in _Z19stdin_event_handleriPv (error=-1,
client_data=0x200a97a8) at ../../binutils-gdb/gdb/event-top.c:505
#14 0x102af9a8 in _ZL17handle_file_eventP12file_handleri
(file_ptr=0x20142908, ready_mask=1) at
../../binutils-gdb/gdb/event-loop.c:733
#15 0x102b012c in _ZL18gdb_wait_for_eventi (block=-1) at
../../binutils-gdb/gdb/event-loop.c:859
#16 0x102b0440 in _Z16gdb_do_one_eventv.part.2 () at
../../binutils-gdb/gdb/event-loop.c:347
#17 0x102b06a0 in _Z16start_event_loopv () at
../../binutils-gdb/gdb/common/common-exceptions.h:221
#18 0x10000414 in _ZL21captured_command_loopPv (data=0xffffffff) at
../../binutils-gdb/gdb/main.c:325
#19 0x102aaf34 in _Z12catch_errorsPFiPvES_Pc11return_mask
(func=@0x200643ac: 0x100003d4 <_ZL21captured_command_loopPv>,
func_args=0x0,
    errstring=0x105963d4 <_GLOBAL__F_interpreter_p+980> "",
mask=RETURN_MASK_ALL) at ../../binutils-gdb/gdb/exceptions.c:236
#20 0x10001988 in _Z8gdb_mainP18captured_main_args (args=0x0) at
../../binutils-gdb/gdb/main.c:2302
#21 0x100003a4 in main (argc=-1, argv=<incomplete type>) at
../../binutils-gdb/gdb/gdb.c:32

If I "continue", I get the followings,

(top-gdb) bt
#0  0xd057a02c in pthread_kill () from /usr/lib/libpthreads.a(shr_xpg5.o)
#1  0xd057940c in _p_raise () from /usr/lib/libpthreads.a(shr_xpg5.o)
#2  0xd0123348 in raise () from /usr/lib/libc.a(shr.o)
#3  0xd018991c in abort () from /usr/lib/libc.a(shr.o)
#4  0x1001986c in uw_init_context_1 (context=0x2ff216e8,
outer_cfa=0x2ff21ae0, outer_ra=0x1001ac80
<_Unwind_Resume_or_Rethrow+212>)
    at ../../../gcc-6.1.0/libgcc/unwind-dw2.c:13
#5  0x1001a520 in _Unwind_RaiseException (exc=0x20147f78) at
../../../gcc-6.1.0/libgcc/unwind.inc:88
#6  0x1001ac80 in _Unwind_Resume_or_Rethrow (exc=0x20147f78) at
../../../gcc-6.1.0/libgcc/unwind.inc:252
#7  0x1002a138 in __cxa_rethrow () at  _start_ :118
#8  0x1001d410 in __gnu_cxx::__verbose_terminate_handler () at
../../../../gcc-6.1.0/libstdc++-v3/libsupc++/vterminate.cc:80
#9  0x1002a568 in __cxxabiv1::__terminate (handler=<incomplete type>)
at ../../../../gcc-6.1.0/libstdc++-v3/libsupc++/eh_terminate.cc:47
#10 0x1001d2c8 in std::terminate () at  _start_ :57
#11 0x1002a8d8 in __cxa_throw (obj=<error reading variable>,
tinfo=<error reading variable>, dest=<error reading variable>) at
_start_ :87
#12 0x10030d40 in _ZL19throw_exception_cxx13gdb_exception
(exception=...) at
../../binutils-gdb/gdb/common/common-exceptions.c:16
#13 0x10030e48 in _ZL8throw_it13return_reason6errorsPKcPc
(reason=RETURN_ERROR, error=GENERIC_ERROR,
    fmt=0xffffffff <error: Cannot access memory at address
0xffffffff>, ap=0xffffffff <error: Cannot access memory at address
0xffffffff>)
    at ../../binutils-gdb/gdb/common/common-exceptions.c:317
#14 0x10031390 in _Z12throw_verror6errorsPKcPc (error=GDB_NO_ERROR,
fmt=0xffffffff <error: Cannot access memory at address 0xffffffff>,
    ap=0xffffffff <error: Cannot access memory at address 0xffffffff>)
at ../../binutils-gdb/gdb/common/common-exceptions.c:379
#15 0x1000f940 in _Z6verrorPKcPc (string=0x0, args=0xffffffff <error:
Cannot access memory at address 0xffffffff>)
    at ../../binutils-gdb/gdb/utils.c:477
#16 0x1002e6a4 in _Z5errorPKcz (fmt=0x0) at
../../binutils-gdb/gdb/common/errors.c:43
#17 0x100d90f0 in _ZL12kill_commandPci (arg=0x0, from_tty=-1) at
../../binutils-gdb/gdb/infcmd.c:2578
#18 0x1008b548 in _ZL8do_cfuncP16cmd_list_elementPci (c=0x0,
args=0xffffffff <error: Cannot access memory at address 0xffffffff>,
from_tty=-1)
    at ../../binutils-gdb/gdb/cli/cli-decode.c:105
#19 0x1008f3f8 in _Z8cmd_funcP16cmd_list_elementPci (cmd=0x20112988,
args=0x0, from_tty=1) at ../../binutils-gdb/gdb/cli/cli-decode.c:1913
#20 0x10061218 in _Z15execute_commandPci (p=0x200aa3a8 "kill",
from_tty=1) at ../../binutils-gdb/gdb/top.c:80
#21 0x1002fed4 in _Z15command_handlerPc (command=0x200aa3a8 "kill") at
../../binutils-gdb/gdb/event-top.c:577
#22 0x1003033c in _Z20command_line_handlerPc (rl=0x0) at
../../binutils-gdb/gdb/event-top.c:25
#23 0x1002ea40 in _ZL23gdb_rl_callback_handlerPc (rl=0x200aa5b8
"kill") at ../../binutils-gdb/gdb/event-top.c:200
#24 0x100320a8 in rl_callback_read_char () at
../../binutils-gdb/readline/callback.c:220
#25 0x1002e8f0 in _ZL33gdb_rl_callback_read_char_wrapperPv
(client_data=0x0) at ../../binutils-gdb/gdb/event-top.c:173
#26 0x1002f540 in _Z19stdin_event_handleriPv (error=0,
client_data=0x200aa3b8) at ../../binutils-gdb/gdb/event-top.c:505
#27 0x102af928 in _ZL17handle_file_eventP12file_handleri
(file_ptr=0x20143518, ready_mask=1) at
../../binutils-gdb/gdb/event-loop.c:733
#28 0x102b00ac in _ZL18gdb_wait_for_eventi (block=-1) at
../../binutils-gdb/gdb/event-loop.c:859
---Type <return> to continue, or q <return> to quit---
#29 0x102b03c0 in _Z16gdb_do_one_eventv.part.2 () at
../../binutils-gdb/gdb/event-loop.c:347
#30 0x102b0620 in _Z16start_event_loopv () at
../../binutils-gdb/gdb/common/common-exceptions.h:221
#31 0x10000414 in _ZL21captured_command_loopPv (data=0x0) at
../../binutils-gdb/gdb/main.c:325
#32 0x102aaeb4 in _Z12catch_errorsPFiPvES_Pc11return_mask
(func=@0x20064fc0: 0x100003d4 <_ZL21captured_command_loopPv>,
func_args=0x0,
    errstring=0x10596354 <_GLOBAL__F_interpreter_p+980> "",
mask=RETURN_MASK_ALL) at ../../binutils-gdb/gdb/exceptions.c:236
#33 0x10001988 in _Z8gdb_mainP18captured_main_args (args=0x0) at
../../binutils-gdb/gdb/main.c:2302
#34 0x100003a4 in main (argc=0, argv=<incomplete type>) at
../../binutils-gdb/gdb/gdb.c:32

I don't check the code carefully yet, will do it tomorrow.

-- 
Yao
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.