Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Yo baby yo baby yo." -- Eddie Murphy


devel / comp.lang.c / gdb fail

SubjectAuthor
* gdb failjak
`* Re: gdb failScott Lurndal
 `* Re: gdb failjak
  `* Re: gdb failÖö Tiib
   `* Re: gdb failjak
    `- Re: gdb failÖö Tiib

1
gdb fail

<u04hc9$vgi7$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=25223&group=comp.lang.c#25223

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: nos...@please.ty (jak)
Newsgroups: comp.lang.c
Subject: gdb fail
Date: Thu, 30 Mar 2023 19:37:13 +0200
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <u04hc9$vgi7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 30 Mar 2023 17:37:13 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e07925e24a7d9a0b2b08f20f20983a9c";
logging-data="1032775"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX192NieaHrgb6Pr9ge4l88ZI"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.15
Cancel-Lock: sha1:iIrXrItD5o3BYBCm4kbWfvLVRLg=
X-Mozilla-News-Host: snews://news.eternal-september.org:563
 by: jak - Thu, 30 Mar 2023 17:37 UTC

Hi everyone,
I installed msys2 with C compiler on my windows 10 system and its
console works fine. It also works well using the codeblocks gui from
windows and, adding the path to the PATH, I can also compile from the
cmd prompt but gdb doesn't work. Could anyone tell me how to fix the
problem?
This is what it displays when giving the 'l' command from gdb:

Copyright (C) 2023 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-w64-mingw32".
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 pp...
(gdb) l
1
C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/misc/mbrtowc.c: No
such file or directory.
(gdb) l
1 in C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/misc/mbrtowc.c
(gdb)

Re: gdb fail

<e%jVL.375198$Ldj8.276568@fx47.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=25224&group=comp.lang.c#25224

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!peer03.ams4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx47.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: gdb fail
Newsgroups: comp.lang.c
References: <u04hc9$vgi7$1@dont-email.me>
Lines: 45
Message-ID: <e%jVL.375198$Ldj8.276568@fx47.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 30 Mar 2023 17:52:10 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 30 Mar 2023 17:52:10 GMT
X-Received-Bytes: 2319
 by: Scott Lurndal - Thu, 30 Mar 2023 17:52 UTC

jak <nospam@please.ty> writes:
>Hi everyone,
>I installed msys2 with C compiler on my windows 10 system and its
>console works fine. It also works well using the codeblocks gui from
>windows and, adding the path to the PATH, I can also compile from the
>cmd prompt but gdb doesn't work. Could anyone tell me how to fix the
>problem?
>This is what it displays when giving the 'l' command from gdb:
>
>Copyright (C) 2023 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-w64-mingw32".
>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 pp...
>(gdb) l
>1
>C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/misc/mbrtowc.c: No
>such file or directory.
>(gdb) l
>1 in C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/misc/mbrtowc.c
>(gdb)

That's not a problem with gdb. It can't find the source for the
crt (C Runtime) that comes with mingw. Either you didn't install
it, or you installed it in a different directory.

Try setting a breakpoint on main, then run to breakpoint and
use the 'l' command.

(gdb) b main
(gdb) r
....
(gdb) l

Re: gdb fail

<u04lss$10b5m$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=25225&group=comp.lang.c#25225

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: nos...@please.ty (jak)
Newsgroups: comp.lang.c
Subject: Re: gdb fail
Date: Thu, 30 Mar 2023 20:54:20 +0200
Organization: A noiseless patient Spider
Lines: 79
Message-ID: <u04lss$10b5m$1@dont-email.me>
References: <u04hc9$vgi7$1@dont-email.me> <e%jVL.375198$Ldj8.276568@fx47.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 30 Mar 2023 18:54:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e07925e24a7d9a0b2b08f20f20983a9c";
logging-data="1060022"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/uponqopcfzxhqp8EVKloN"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.15
Cancel-Lock: sha1:IqSSi15WpnK7+ZZUxINj41AVY1I=
In-Reply-To: <e%jVL.375198$Ldj8.276568@fx47.iad>
 by: jak - Thu, 30 Mar 2023 18:54 UTC

Scott Lurndal ha scritto:
> jak <nospam@please.ty> writes:
>> Hi everyone,
>> I installed msys2 with C compiler on my windows 10 system and its
>> console works fine. It also works well using the codeblocks gui from
>> windows and, adding the path to the PATH, I can also compile from the
>> cmd prompt but gdb doesn't work. Could anyone tell me how to fix the
>> problem?
>> This is what it displays when giving the 'l' command from gdb:
>>
>> Copyright (C) 2023 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-w64-mingw32".
>> 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 pp...
>> (gdb) l
>> 1
>> C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/misc/mbrtowc.c: No
>> such file or directory.
>> (gdb) l
>> 1 in C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/misc/mbrtowc.c
>> (gdb)
>
>
> That's not a problem with gdb. It can't find the source for the
> crt (C Runtime) that comes with mingw. Either you didn't install
> it, or you installed it in a different directory.
>
> Try setting a breakpoint on main, then run to breakpoint and
> use the 'l' command.
>
> (gdb) b main
> (gdb) r
> ...
> (gdb) l
>

It gives the same problem. Now I've had a look with the 'show
configuration' command and, of course, all paths are configured by the
installation in msys2:

******************
This GDB was configured as follows:
configure
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
--with-auto-load-dir=$debugdir:$datadir/auto-load
--with-auto-load-safe-path=$debugdir:$datadir/auto-load
--with-expat
-> --with-gdb-datadir=/mingw64/share/gdb (relocatable)
-> --with-jit-reader-dir=/mingw64/lib/gdb (relocatable)
--without-libunwind-ia64
--with-lzma
--without-babeltrace
--without-intel-pt
--with-mpfr
--with-xxhash
-> --with-python=/mingw64 (relocatable)
-> --with-python-libdir=/mingw64/lib (relocatable)
--without-debuginfod
--without-guile
--disable-source-highlight
--enable-threading
-> --with-separate-debug-dir=/mingw64/lib/debug (relocatable)
-> --with-system-gdbinit=/mingw64/etc/gdbinit (relocatable)
******************

Now the question would be: is there a way to split the configuration
when in msys2 environment and when in cmd environment?

Re: gdb fail

<dab904dc-2e7c-4da2-a9b6-f02ae9f6a0f8n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=25226&group=comp.lang.c#25226

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:8d5:b0:748:4a62:2ba3 with SMTP id z21-20020a05620a08d500b007484a622ba3mr5506055qkz.8.1680253508361;
Fri, 31 Mar 2023 02:05:08 -0700 (PDT)
X-Received: by 2002:ad4:5910:0:b0:5bd:ed35:9546 with SMTP id
ez16-20020ad45910000000b005bded359546mr5389100qvb.1.1680253508148; Fri, 31
Mar 2023 02:05:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Fri, 31 Mar 2023 02:05:07 -0700 (PDT)
In-Reply-To: <u04lss$10b5m$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=84.50.190.190; posting-account=pysjKgkAAACLegAdYDFznkqjgx_7vlUK
NNTP-Posting-Host: 84.50.190.190
References: <u04hc9$vgi7$1@dont-email.me> <e%jVL.375198$Ldj8.276568@fx47.iad> <u04lss$10b5m$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <dab904dc-2e7c-4da2-a9b6-f02ae9f6a0f8n@googlegroups.com>
Subject: Re: gdb fail
From: oot...@hot.ee (Öö Tiib)
Injection-Date: Fri, 31 Mar 2023 09:05:08 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4663
 by: Öö Tiib - Fri, 31 Mar 2023 09:05 UTC

On Thursday, 30 March 2023 at 21:54:33 UTC+3, jak wrote:
> Scott Lurndal ha scritto:
> > jak <nos...@please.ty> writes:
> >> Hi everyone,
> >> I installed msys2 with C compiler on my windows 10 system and its
> >> console works fine. It also works well using the codeblocks gui from
> >> windows and, adding the path to the PATH, I can also compile from the
> >> cmd prompt but gdb doesn't work. Could anyone tell me how to fix the
> >> problem?
> >> This is what it displays when giving the 'l' command from gdb:
> >>
> >> Copyright (C) 2023 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-w64-mingw32".
> >> 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 pp...
> >> (gdb) l
> >> 1
> >> C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/misc/mbrtowc.c: No
> >> such file or directory.
> >> (gdb) l
> >> 1 in C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/misc/mbrtowc.c
> >> (gdb)
> >
> >
> > That's not a problem with gdb. It can't find the source for the
> > crt (C Runtime) that comes with mingw. Either you didn't install
> > it, or you installed it in a different directory.
> >
> > Try setting a breakpoint on main, then run to breakpoint and
> > use the 'l' command.
> >
> > (gdb) b main
> > (gdb) r
> > ...
> > (gdb) l
> >
> It gives the same problem. Now I've had a look with the 'show
> configuration' command and, of course, all paths are configured by the
> installation in msys2:
>
> ******************
> This GDB was configured as follows:
> configure
> --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
> --with-auto-load-dir=$debugdir:$datadir/auto-load
> --with-auto-load-safe-path=$debugdir:$datadir/auto-load
> --with-expat
> -> --with-gdb-datadir=/mingw64/share/gdb (relocatable)
> -> --with-jit-reader-dir=/mingw64/lib/gdb (relocatable)
> --without-libunwind-ia64
> --with-lzma
> --without-babeltrace
> --without-intel-pt
> --with-mpfr
> --with-xxhash
> -> --with-python=/mingw64 (relocatable)
> -> --with-python-libdir=/mingw64/lib (relocatable)
> --without-debuginfod
> --without-guile
> --disable-source-highlight
> --enable-threading
> -> --with-separate-debug-dir=/mingw64/lib/debug (relocatable)
> -> --with-system-gdbinit=/mingw64/etc/gdbinit (relocatable)
> ******************
>
> Now the question would be: is there a way to split the configuration
> when in msys2 environment and when in cmd environment?

It seems to be that gdb is confused about where the c runtime source
code is located. You want to debug C runtime? It seemingly tells to
you that it expects the mbrtowc.c to be:
"C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/misc/mbrtowc.c"
It is not the case? Why? Apparently your C runtime (used in cmd environment
build) was built so that the file was in that location.

Re: gdb fail

<u069fe$1bs82$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=25227&group=comp.lang.c#25227

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: nos...@please.ty (jak)
Newsgroups: comp.lang.c
Subject: Re: gdb fail
Date: Fri, 31 Mar 2023 11:34:39 +0200
Organization: A noiseless patient Spider
Lines: 97
Message-ID: <u069fe$1bs82$1@dont-email.me>
References: <u04hc9$vgi7$1@dont-email.me> <e%jVL.375198$Ldj8.276568@fx47.iad>
<u04lss$10b5m$1@dont-email.me>
<dab904dc-2e7c-4da2-a9b6-f02ae9f6a0f8n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 31 Mar 2023 09:34:38 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f607ca14f998c1b9c0c244c9308b080d";
logging-data="1437954"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Riftt1hnYs57uDE67fJkh"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
Cancel-Lock: sha1:XWOh9hIvgx2EIS05C23gWB5JZbA=
In-Reply-To: <dab904dc-2e7c-4da2-a9b6-f02ae9f6a0f8n@googlegroups.com>
 by: jak - Fri, 31 Mar 2023 09:34 UTC

Öö Tiib ha scritto:
> On Thursday, 30 March 2023 at 21:54:33 UTC+3, jak wrote:
>> Scott Lurndal ha scritto:
>>> jak <nos...@please.ty> writes:
>>>> Hi everyone,
>>>> I installed msys2 with C compiler on my windows 10 system and its
>>>> console works fine. It also works well using the codeblocks gui from
>>>> windows and, adding the path to the PATH, I can also compile from the
>>>> cmd prompt but gdb doesn't work. Could anyone tell me how to fix the
>>>> problem?
>>>> This is what it displays when giving the 'l' command from gdb:
>>>>
>>>> Copyright (C) 2023 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-w64-mingw32".
>>>> 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 pp...
>>>> (gdb) l
>>>> 1
>>>> C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/misc/mbrtowc.c: No
>>>> such file or directory.
>>>> (gdb) l
>>>> 1 in C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/misc/mbrtowc.c
>>>> (gdb)
>>>
>>>
>>> That's not a problem with gdb. It can't find the source for the
>>> crt (C Runtime) that comes with mingw. Either you didn't install
>>> it, or you installed it in a different directory.
>>>
>>> Try setting a breakpoint on main, then run to breakpoint and
>>> use the 'l' command.
>>>
>>> (gdb) b main
>>> (gdb) r
>>> ...
>>> (gdb) l
>>>
>> It gives the same problem. Now I've had a look with the 'show
>> configuration' command and, of course, all paths are configured by the
>> installation in msys2:
>>
>> ******************
>> This GDB was configured as follows:
>> configure
>> --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
>> --with-auto-load-dir=$debugdir:$datadir/auto-load
>> --with-auto-load-safe-path=$debugdir:$datadir/auto-load
>> --with-expat
>> -> --with-gdb-datadir=/mingw64/share/gdb (relocatable)
>> -> --with-jit-reader-dir=/mingw64/lib/gdb (relocatable)
>> --without-libunwind-ia64
>> --with-lzma
>> --without-babeltrace
>> --without-intel-pt
>> --with-mpfr
>> --with-xxhash
>> -> --with-python=/mingw64 (relocatable)
>> -> --with-python-libdir=/mingw64/lib (relocatable)
>> --without-debuginfod
>> --without-guile
>> --disable-source-highlight
>> --enable-threading
>> -> --with-separate-debug-dir=/mingw64/lib/debug (relocatable)
>> -> --with-system-gdbinit=/mingw64/etc/gdbinit (relocatable)
>> ******************
>>
>> Now the question would be: is there a way to split the configuration
>> when in msys2 environment and when in cmd environment?
>
> It seems to be that gdb is confused about where the c runtime source
> code is located. You want to debug C runtime? It seemingly tells to
> you that it expects the mbrtowc.c to be:
> "C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/misc/mbrtowc.c"
> It is not the case? Why? Apparently your C runtime (used in cmd environment
> build) was built so that the file was in that location.
>

The program I'm debugging is just a 'hello world' like, written in C and
gcc compiled with the '-g' option. The file "C:/M/mingw-w64-crt-git/src
/mingw-w64/mingw-w64-crt/misc/mbrtowc.c" on my disk doesn't exist and
neither does its path. I didn't build gcc but installed 'msys2' from
which I installed the development toolchains, which works with
msys2/bash, windows/codeblocks and windows/cmd but windows/cmd/gdb is an
exception and doesn't work fine.

Re: gdb fail

<f69a356f-714c-4262-bcb9-586e163ad029n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=25228&group=comp.lang.c#25228

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:5a0a:0:b0:3de:fa64:ff24 with SMTP id n10-20020ac85a0a000000b003defa64ff24mr10319161qta.4.1680265628439;
Fri, 31 Mar 2023 05:27:08 -0700 (PDT)
X-Received: by 2002:a05:6214:192e:b0:56b:e002:75df with SMTP id
es14-20020a056214192e00b0056be00275dfmr4668073qvb.5.1680265628175; Fri, 31
Mar 2023 05:27:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Fri, 31 Mar 2023 05:27:07 -0700 (PDT)
In-Reply-To: <u069fe$1bs82$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=84.50.190.190; posting-account=pysjKgkAAACLegAdYDFznkqjgx_7vlUK
NNTP-Posting-Host: 84.50.190.190
References: <u04hc9$vgi7$1@dont-email.me> <e%jVL.375198$Ldj8.276568@fx47.iad>
<u04lss$10b5m$1@dont-email.me> <dab904dc-2e7c-4da2-a9b6-f02ae9f6a0f8n@googlegroups.com>
<u069fe$1bs82$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f69a356f-714c-4262-bcb9-586e163ad029n@googlegroups.com>
Subject: Re: gdb fail
From: oot...@hot.ee (Öö Tiib)
Injection-Date: Fri, 31 Mar 2023 12:27:08 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 6233
 by: Öö Tiib - Fri, 31 Mar 2023 12:27 UTC

On Friday, 31 March 2023 at 12:34:53 UTC+3, jak wrote:
> Öö Tiib ha scritto:
> > On Thursday, 30 March 2023 at 21:54:33 UTC+3, jak wrote:
> >> Scott Lurndal ha scritto:
> >>> jak <nos...@please.ty> writes:
> >>>> Hi everyone,
> >>>> I installed msys2 with C compiler on my windows 10 system and its
> >>>> console works fine. It also works well using the codeblocks gui from
> >>>> windows and, adding the path to the PATH, I can also compile from the
> >>>> cmd prompt but gdb doesn't work. Could anyone tell me how to fix the
> >>>> problem?
> >>>> This is what it displays when giving the 'l' command from gdb:
> >>>>
> >>>> Copyright (C) 2023 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-w64-mingw32".
> >>>> 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 pp...
> >>>> (gdb) l
> >>>> 1
> >>>> C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/misc/mbrtowc.c: No
> >>>> such file or directory.
> >>>> (gdb) l
> >>>> 1 in C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/misc/mbrtowc..c
> >>>> (gdb)
> >>>
> >>>
> >>> That's not a problem with gdb. It can't find the source for the
> >>> crt (C Runtime) that comes with mingw. Either you didn't install
> >>> it, or you installed it in a different directory.
> >>>
> >>> Try setting a breakpoint on main, then run to breakpoint and
> >>> use the 'l' command.
> >>>
> >>> (gdb) b main
> >>> (gdb) r
> >>> ...
> >>> (gdb) l
> >>>
> >> It gives the same problem. Now I've had a look with the 'show
> >> configuration' command and, of course, all paths are configured by the
> >> installation in msys2:
> >>
> >> ******************
> >> This GDB was configured as follows:
> >> configure
> >> --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32
> >> --with-auto-load-dir=$debugdir:$datadir/auto-load
> >> --with-auto-load-safe-path=$debugdir:$datadir/auto-load
> >> --with-expat
> >> -> --with-gdb-datadir=/mingw64/share/gdb (relocatable)
> >> -> --with-jit-reader-dir=/mingw64/lib/gdb (relocatable)
> >> --without-libunwind-ia64
> >> --with-lzma
> >> --without-babeltrace
> >> --without-intel-pt
> >> --with-mpfr
> >> --with-xxhash
> >> -> --with-python=/mingw64 (relocatable)
> >> -> --with-python-libdir=/mingw64/lib (relocatable)
> >> --without-debuginfod
> >> --without-guile
> >> --disable-source-highlight
> >> --enable-threading
> >> -> --with-separate-debug-dir=/mingw64/lib/debug (relocatable)
> >> -> --with-system-gdbinit=/mingw64/etc/gdbinit (relocatable)
> >> ******************
> >>
> >> Now the question would be: is there a way to split the configuration
> >> when in msys2 environment and when in cmd environment?
> >
> > It seems to be that gdb is confused about where the c runtime source
> > code is located. You want to debug C runtime? It seemingly tells to
> > you that it expects the mbrtowc.c to be:
> > "C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/misc/mbrtowc.c"
> > It is not the case? Why? Apparently your C runtime (used in cmd environment
> > build) was built so that the file was in that location.
> >
> The program I'm debugging is just a 'hello world' like, written in C and
> gcc compiled with the '-g' option.

So you want to list code in debugger that is not in mbrtowc.c,
but something else "hello word like", but debugger complains that it can't
find source code for mbrtowc.c?

> The file "C:/M/mingw-w64-crt-git/src
> /mingw-w64/mingw-w64-crt/misc/mbrtowc.c" on my disk doesn't exist and
> neither does its path. I didn't build gcc but installed 'msys2' from

It is not gcc, it is C standard library file there.

> which I installed the development toolchains, which works with
> msys2/bash, windows/codeblocks and windows/cmd but windows/cmd/gdb is an
> exception and doesn't work fine.

What does it mean "works with"? Do the msys2/bash and windows/codeblocks list
you contents of mbrtowc.c when you use list command from those?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor