pkgsrc-Users archive

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

Re: getting proper debug information



On Friday, February 7th, 2025 at 5:06 PM, Martin Husemann <martin%duskware.de@localhost> wrote:

> On Fri, Feb 07, 2025 at 02:28:06PM +0000, pin wrote:
> 
> > How exactly should I launch it?
> 
> 
> I usualy do something like:
> 
> gdb inlyne
> run view README.md

gdb inlyne
GNU gdb (GDB) 15.1
Copyright (C) 2024 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.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64--netbsd".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from inlyne...
warning: Unsupported auto-load script at offset 0 in section .debug_gdb_scripts
of file /usr/local/bin/inlyne.
Use `info auto-load python-scripts [REGEXP]' to list them.
(gdb) run view README.md
Starting program: /usr/local/bin/inlyne view README.md
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1423: internal-error: switch_to_thread: Assertion `thr != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
----- Backtrace -----
0x113abdb _Z22gdb_internal_backtracev
0xffdf07 _ZL17internal_vproblemP16internal_problemPKciS2_P13__va_list_tag
0xffe237 _Z15internal_verrorPKciS0_P13__va_list_tag
0x1417c27 _Z18internal_error_locPKciS0_z
0x10269b7 _Z16switch_to_threadP11thread_info.part.0
0x10285f5 _Z16switch_to_threadP22process_stratum_target6ptid_t
0x13074db _Z16startup_inferiorP22process_stratum_targetiiP17target_waitstatusP6ptid_t
0x13086e6 _Z20gdb_startup_inferiorii
0x128c376 _ZN17inf_ptrace_target15create_inferiorEPKcRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPPci
0x1106306 _ZL13run_command_1PKci7run_how
0x12564d5 _Z8cmd_funcP16cmd_list_elementPKci
0x1025a7a _Z15execute_commandPKci
0x11390b8 _Z15command_handlerPKc
0x113a7c7 _Z20command_line_handlerOSt10unique_ptrIcN3gdb13xfree_deleterIcEEE
0x11399ad _ZL23gdb_rl_callback_handlerPc
0x1488126 rl_callback_read_char
0x1139b36 _ZL42gdb_rl_callback_read_char_wrapper_noexceptv
0x1139d8e _ZL33gdb_rl_callback_read_char_wrapperPv
0x1000d89 _ZL19stdin_event_handleriPv
0x1411d45 _ZL18gdb_wait_for_eventi.part.0
0x141246f _Z16gdb_do_one_eventi
0x10ba85d _ZL21captured_command_loopv
0x10bd1f7 _Z8gdb_mainP18captured_main_args
0x14f71d7 main
---------------------
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1423: internal-error: switch_to_thread: Assertion `thr != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

> but your version should also work.
> 
> If you do
> 
> gdb -ex=r --args ls -a
> 
> it probably will work for you too. So the gdb lossage must be related to the
> binary being debuged and we are back at square one.
> 
> Martin

Indeed :(

gdb -ex=r --args ls -a
GNU gdb (GDB) 15.1
Copyright (C) 2024 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.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64--netbsd".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ls...
(No debugging symbols found in ls)
Starting program: /bin/ls -a
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1423: internal-error: switch_to_thread: Assertion `thr != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
----- Backtrace -----
0x502bdb _Z22gdb_internal_backtracev
0x3c5f07 _ZL17internal_vproblemP16internal_problemPKciS2_P13__va_list_tag
0x3c6237 _Z15internal_verrorPKciS0_P13__va_list_tag
0x7dfc27 _Z18internal_error_locPKciS0_z
0x3ee9b7 _Z16switch_to_threadP11thread_info.part.0
0x3f05f5 _Z16switch_to_threadP22process_stratum_target6ptid_t
0x6cf4db _Z16startup_inferiorP22process_stratum_targetiiP17target_waitstatusP6ptid_t
0x6d06e6 _Z20gdb_startup_inferiorii
0x654376 _ZN17inf_ptrace_target15create_inferiorEPKcRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPPci
0x4ce306 _ZL13run_command_1PKci7run_how
0x61e4d5 _Z8cmd_funcP16cmd_list_elementPKci
0x3eda7a _Z15execute_commandPKci
0x4826fd _ZL20catch_command_errorsPFvPKciES0_ib
0x4827c4 _ZL15execute_cmdargsPKSt6vectorI6cmdargSaIS0_EE11cmdarg_kindS5_Pi
0x4847ba _ZL15captured_main_1P18captured_main_args
0x4851f2 _Z8gdb_mainP18captured_main_args
0x8bf1d7 main
---------------------
/usr/src/external/gpl3/gdb/lib/libgdb/../../dist/gdb/thread.c:1423: internal-error: switch_to_thread: Assertion `thr != NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y

Argh ...
Thanks!


Home | Main Index | Thread Index | Old Index