Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdb not able to debug #8516

Open
1 of 2 tasks
vingocheng opened this issue Jun 16, 2022 · 39 comments
Open
1 of 2 tasks

gdb not able to debug #8516

vingocheng opened this issue Jun 16, 2022 · 39 comments
Labels

Comments

@vingocheng
Copy link

Version

Microsoft Windows [版本 10.0.19042.1706]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

Ubuntu-22.04 default version: 2

Distro Version

Ubuntu-22.04

Other Software

gdb --version GNU gdb (Ubuntu 12.0.90-0ubuntu1) 12.0.90
gcc --version gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0

Repro Steps

  1. write a simple test.c to output hello world
  2. run 'gcc -g test.c'
  3. gdb a.out
  4. in gdb , input "l main" , "b main", "run"
  5. it will report error :
    Starting program: /mnt/c/junk/a.out
    warning: opening /proc/PID/mem file for lwp 92.92 failed: No such file or directory (2)
    Warning:
    Cannot insert breakpoint 1.
    Cannot access memory at address 0x8001149

Expected Behavior

gdb is expecting to work.

Actual Behavior

as above input, you can find, gdb not able to work.

Diagnostic Logs

No response

@fazaldegui
Copy link

fazaldegui commented Aug 10, 2022

The same here.
I've found a fix to the gdb binaries you can see in:
#8356
In brief, the new gdb doesn't have the fallback of using ptrace if /proc/[pid]/mem fails. It can be restored be modifying two byte of the gdb binary, as:
echo -ne '\x90\x90' | sudo dd of=/usr/bin/gdb seek=$((0x335bad)) bs=1 count=2 conv=notrunc

But this is just a "ugly" patch means the /proc/[pid]/mem is fix in WSL.

Regards

@vingocheng
Copy link
Author

Thanks a lot for your reply.
I tested the patch, it can work well.

Also this not happened on WSL-2

Regards

@wsourdeau
Copy link

I am not sure I understand. You closed this bug because a hack has been found? The fundamental issue is still occurring, any plans to fix it?

@jdknox
Copy link

jdknox commented Dec 23, 2022

This is happening on WSL2. Please reopen.

warning: opening /proc/PID/mem file for lwp 15355.15355 failed: No such file or directory (2)
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x8001150
$ wsl.exe --status
Default Distribution: Ubuntu-22.04
Default Version: 2

@vingocheng
Copy link
Author

I am not sure I understand. You closed this bug because a hack has been found? The fundamental issue is still occurring, any plans to fix it?

yes, the hack has been verified and the hack can work.
since it is a hack patch, not fix fundamental issue.
Sorry, I am not a developer of this project. I will look at this issue further.

@vingocheng
Copy link
Author

I will reopen this issue since you found it reopen.
what are gdb/gcc version? I guess that information may help the real developer to address the issue.

BTW: I am not the developer of this project. ^_^

@vingocheng vingocheng reopened this Dec 26, 2022
@etorth
Copy link

etorth commented Dec 29, 2022

The same here. I've found a fix to the gdb binaries you can see in: #8356 In brief, the new gdb doesn't have the fallback of using ptrace if /proc/[pid]/mem fails. It can be restored be modifying two byte of the gdb binary, as: echo -ne '\x90\x90' | sudo dd of=/usr/bin/gdb seek=$((0x335bad)) bs=1 count=2 conv=notrunc

But this is just a "ugly" patch means the /proc/[pid]/mem is fix in WSL.

Regards

not work for me.
This is crazy, halt hundreds of thousands people using gdb just because of some engineer's preference.
I call this arrogance.

@quiret
Copy link

quiret commented Jan 4, 2023

The same here. I've found a fix to the gdb binaries you can see in: #8356 In brief, the new gdb doesn't have the fallback of using ptrace if /proc/[pid]/mem fails. It can be restored be modifying two byte of the gdb binary, as: echo -ne '\x90\x90' | sudo dd of=/usr/bin/gdb seek=$((0x335bad)) bs=1 count=2 conv=notrunc
But this is just a "ugly" patch means the /proc/[pid]/mem is fix in WSL.
Regards

not work for me. This is crazy, halt hundreds of thousands people using gdb just because of some engineer's preference. I call this arrogance.

Life is quite sad, isn't it? The wrong people get to make decisions. Imagine how messed up life will become if random stupid AI get to make decisions like that.

@wsourdeau
Copy link

I am not sure I understand. You closed this bug because a hack has been found? The fundamental issue is still occurring, any plans to fix it?

yes, the hack has been verified and the hack can work. since it is a hack patch, not fix fundamental issue. Sorry, I am not a developer of this project. I will look at this issue further.

Ah ok. I understand why you closed it. It's nice that some hack has been found but this shows a fundamental bug in the way WSL handles debugging traps. Thus I would indeed leave a WSL developer work on it properly and close it when the issue has been fixed.

@leha-bot
Copy link

leha-bot commented Feb 17, 2023

Hey, guys, any updates on this? This bug is likely blocker for anyone which has to use any fresh versions of debuggers or any another software which wants to read /proc/pid/memory
@benhillis , may you add the /proc/ tag and take a look this bug, please (sorry for mention).
Thanks in advance.
upd.: Related bugs: #8356 #547

@orodri
Copy link

orodri commented Feb 23, 2023

I built gdb 13.1 from source (released 2/19/23) and I am able to debug with it on WSL2 (Ubuntu 22.04.2 LTS) though I still get the warnings:

warning: opening /proc/self/mem file failed: No such file or directory (2)
warning: opening /proc/PID/mem file for lwp 31679.31679 failed: No such file or directory (2)

It is unclear to me whether building from source or using 13.1 was the (partial?) fix.

@aaron-jencks
Copy link

this "patch" didn't work for me, I don't remember having this issue back with ubuntu 18.04, maybe there's something there. I would switch back to that version, but I can't install valgrind in that version because of the libc6 issue.

@vingocheng
Copy link
Author

  1. Download the GDB source code and compile under WSL
  2. Remove the pre-installed GDB
  3. install the new build GDB, it can work.

@etorth
Copy link

etorth commented Feb 28, 2023

  1. Download the GDB source code and compile under WSL
  2. Remove the pre-installed GDB
  3. install the new build GDB, it can work.

not work for me, which gdb version you are using?

@vingocheng
Copy link
Author

The version is : 13.1
Package : https://ftp.gnu.org/gnu/gdb/gdb-13.1.tar.xz

@etorth
Copy link

etorth commented Feb 28, 2023

The version is : 13.1 Package : https://ftp.gnu.org/gnu/gdb/gdb-13.1.tar.xz

Yes it worked, although warnings are still there but not a show stopper anymore.
Thanks man!

@mikecancilla
Copy link

The version is : 13.1 Package : https://ftp.gnu.org/gnu/gdb/gdb-13.1.tar.xz

Thank you! This is the answer. Other solutions talk about going back to gdb 9.2, but you can not easily do that with Ubuntu 22.04.

@YuriSizuku
Copy link

The version is : 13.1 Package : https://ftp.gnu.org/gnu/gdb/gdb-13.1.tar.xz

Yes it worked, although warnings are still there but not a show stopper anymore. Thanks man!

Unfortunately this still not worked for me. Even a hello world can not access breakpoint.
My enviroment is as below

  NAME                   STATE           VERSION
* Ubuntu-22.04           Running         2
  docker-desktop         Running         2
  docker-desktop-data    Running         2

GNU gdb (GDB) 13.1
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.

Here is the gdb information.

This is gdb ./hello

GNU gdb (GDB) 13.1
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-pc-linux-gnu".
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 ./hello...
(gdb) b main
Breakpoint 1 at 0x1175: file hello.c, line 3.
e(gdb) run
Starting program: /d/Software/develop/VSCode/tools/example/vscode_c/hello
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x1169
(gdb) disassemble main
Dump of assembler code for function main:
   0x0000000000001169 <+0>:
Cannot access memory at address 0x1169

This is through sudo gdb ./hello

GNU gdb (GDB) 13.1
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-pc-linux-gnu".
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 ./hello...
(gdb) run
Starting program: /d/Software/develop/VSCode/tools/example/vscode_c/hello
process 3265 is executing new program: /usr/bin/bash
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
process 3265 is executing new program: /d/Software/develop/VSCode/tools/example/vscode_c/hello
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
5, sizeof(p)=8
hello world
[Inferior 1 (process 3265) exited normally]
(gdb) b main
Breakpoint 1 at 0x55c65d2d0175: file hello.c, line 3.
(gdb) run
Starting program: /d/Software/develop/VSCode/tools/example/vscode_c/hello
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x55c65d2d0169

@vingocheng
Copy link
Author

The version is : 13.1 Package : https://ftp.gnu.org/gnu/gdb/gdb-13.1.tar.xz

Yes it worked, although warnings are still there but not a show stopper anymore. Thanks man!

Unfortunately this still not worked for me. Even a hello world can not access breakpoint. My enviroment is as below

  NAME                   STATE           VERSION
* Ubuntu-22.04           Running         2
  docker-desktop         Running         2
  docker-desktop-data    Running         2

GNU gdb (GDB) 13.1
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.

Here is the gdb information.

This is gdb ./hello

GNU gdb (GDB) 13.1
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-pc-linux-gnu".
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 ./hello...
(gdb) b main
Breakpoint 1 at 0x1175: file hello.c, line 3.
e(gdb) run
Starting program: /d/Software/develop/VSCode/tools/example/vscode_c/hello
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x1169
(gdb) disassemble main
Dump of assembler code for function main:
   0x0000000000001169 <+0>:
Cannot access memory at address 0x1169

This is through sudo gdb ./hello

GNU gdb (GDB) 13.1
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-pc-linux-gnu".
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 ./hello...
(gdb) run
Starting program: /d/Software/develop/VSCode/tools/example/vscode_c/hello
process 3265 is executing new program: /usr/bin/bash
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
process 3265 is executing new program: /d/Software/develop/VSCode/tools/example/vscode_c/hello
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
5, sizeof(p)=8
hello world
[Inferior 1 (process 3265) exited normally]
(gdb) b main
Breakpoint 1 at 0x55c65d2d0175: file hello.c, line 3.
(gdb) run
Starting program: /d/Software/develop/VSCode/tools/example/vscode_c/hello
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x55c65d2d0169

How did you get the 'gdb' program ? compile by yourself?
If you compiled by yourself, please also make sure the old installed version GDB is removed first, then install the version that you compiled by yourself.

@YuriSizuku
Copy link

The version is : 13.1 Package : https://ftp.gnu.org/gnu/gdb/gdb-13.1.tar.xz

Yes it worked, although warnings are still there but not a show stopper anymore. Thanks man!

Unfortunately this still not worked for me. Even a hello world can not access breakpoint. My enviroment is as below

  NAME                   STATE           VERSION
* Ubuntu-22.04           Running         2
  docker-desktop         Running         2
  docker-desktop-data    Running         2

GNU gdb (GDB) 13.1
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.

Here is the gdb information.
This is gdb ./hello

GNU gdb (GDB) 13.1
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-pc-linux-gnu".
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 ./hello...
(gdb) b main
Breakpoint 1 at 0x1175: file hello.c, line 3.
e(gdb) run
Starting program: /d/Software/develop/VSCode/tools/example/vscode_c/hello
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x1169
(gdb) disassemble main
Dump of assembler code for function main:
   0x0000000000001169 <+0>:
Cannot access memory at address 0x1169

This is through sudo gdb ./hello

GNU gdb (GDB) 13.1
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-pc-linux-gnu".
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 ./hello...
(gdb) run
Starting program: /d/Software/develop/VSCode/tools/example/vscode_c/hello
process 3265 is executing new program: /usr/bin/bash
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
process 3265 is executing new program: /d/Software/develop/VSCode/tools/example/vscode_c/hello
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
5, sizeof(p)=8
hello world
[Inferior 1 (process 3265) exited normally]
(gdb) b main
Breakpoint 1 at 0x55c65d2d0175: file hello.c, line 3.
(gdb) run
Starting program: /d/Software/develop/VSCode/tools/example/vscode_c/hello
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x55c65d2d0169

How did you get the 'gdb' program ? compile by yourself? If you compiled by yourself, please also make sure the old installed version GDB is removed first, then install the version that you compiled by yourself.

Yes, I compiled from the souce. I uninstalled the old version of gdb. And the gdb version shows that it is v13.1.

@vingocheng
Copy link
Author

I think you need to double check your environment.
you can see the main function address is different in your two cases (sudo, or no sudo).
they should be the same function address as one program.

@chandan22140
Copy link

chandan22140 commented Apr 15, 2023

I think you need to double check your environment. you can see the main function address is different in your two cases (sudo, or no sudo). they should be the same function address as one program.

Beginner CS student here
The gdb-13.1 directory has multiple directories and sub-directories, how can I compile them all, and after I compile the gdb source locally, what should I do next?

@orodri
Copy link

orodri commented Apr 15, 2023

Beginner CS student here The gdb-13.1 directory has multiple directories and sub-directories, how can I compile them all, and after I compile the gdb source locally, what should I do next?

cd gdb-13.1
./configure
make
make install

After installing, confirm:

❯ gdb --version
GNU gdb (GDB) 13.1
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.

@wsourdeau
Copy link

I found out that WSL 2 does not have the issue. Since WSL 1 still seems to be supported, I think the bug should remain open but I believe an upgrade to WSL 2 would be a good recommendation.

@vingocheng
Copy link
Author

I agree with this solution if WSL2 work fine. BTW: I don't verify the solution at my environment.

@stewpend0us
Copy link

  1. Download the GDB source code and compile under WSL
  2. Remove the pre-installed GDB
  3. install the new build GDB, it can work.

This worked for me. Thanks @vingocheng !

for ubuntu 22.04 I did:

sudo apt remove gdb
sudo apt install libgmp-dev
wget https://ftp.gnu.org/gnu/gdb/gdb-13.1.tar.xz
tar -xf gdb-13.1.tar.xz
cd gdb-13.1/
./configure
make -j8
sudo make install

@ademyankov
Copy link

Thanks @stewpend0us , that worked for me!

@ethindp
Copy link

ethindp commented May 19, 2023

I can confirm that the bug still occurs on WSL 1 (and I need WSL 1 because it's faster with NTFS interop). I'd prefer not to build my own GDB but... Erg. Guess I'll have to do that.

@fengjixiong
Copy link

fengjixiong commented Jun 7, 2023

for ubuntu 22.04 I did:

sudo apt remove gdb
sudo apt install libgmp-dev
wget https://ftp.gnu.org/gnu/gdb/gdb-13.1.tar.xz
tar -xf gdb-13.1.tar.xz
cd gdb-13.1/
./configure
make -j8
sudo make install

That works for me, too!
Besides, if someone wants tui, the following commands are needed:

sudo apt install libncurses5-dev
./configure --enable-tui=yes

then the "layout" command can be used in gdb

@tienngtr
Copy link

tienngtr commented Jun 8, 2023

You can install GDB from Ubuntu Support Team PPA if you don't want to rebuild GDB yourself.

@klikevil
Copy link

The same here. I've found a fix to the gdb binaries you can see in: #8356 In brief, the new gdb doesn't have the fallback of using ptrace if /proc/[pid]/mem fails. It can be restored be modifying two byte of the gdb binary, as: echo -ne '\x90\x90' | sudo dd of=/usr/bin/gdb seek=$((0x335bad)) bs=1 count=2 conv=notrunc

But this is just a "ugly" patch means the /proc/[pid]/mem is fix in WSL.

Regards

This worked for me for gdb, but not gdbserver, got anything for that one @fazaldegui

image

@dwoodwor-intel
Copy link

I am still seeing this problem on WSL2:

$ wsl.exe --status
Default Distribution: Ubuntu
Default Version: 2

Windows Subsystem for Linux was last updated on 3/13/2023
WSL automatic updates are on.

Kernel version: 5.10.102.1
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
$ nl -ba -w1 test.c
1	#include <stdio.h>
2	
3	int main() {
4	  printf("Hello, world!\n");
5	}
$ gcc -g -o test test.c
$ gdb ./test
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 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-linux-gnu".
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 ./test...
(gdb) break 4
Breakpoint 1 at 0x1151: file test.c, line 4.
(gdb) run
Starting program: /home/dwoodwor/test
warning: opening /proc/PID/mem file for lwp 583.583 failed: No such file or directory (2)
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x8001151

(gdb)

Installing a newer upstream version of gdb (from the PPA) does fix this for me, but does still have the warnings.

@0xBYTESHIFT
Copy link

0xBYTESHIFT commented Aug 7, 2023

(gdb) b main
Breakpoint 1 at 0xe629: file /home/user/program/Src/UserMain.cpp, line 70.
(gdb) r
Starting program: /home/user/program/tester ./libTests.so
warning: opening /proc/PID/mem file for lwp 27519.27519 failed: No such file or directory (2)
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x800e610

(gdb)

same, wsl is:

PS C:\Users\user> wsl --status
Default Distribution: Ubuntu-22.04
Default Version: 2

and gdb is:

user@VM:~/$ gdb --version
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 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.

it's basically unusable. good job, microsoft. only installing gdb daily build from the PPA helps.

@sonai99
Copy link

sonai99 commented Sep 20, 2023

Any fixes yet?

@0xBYTESHIFT
Copy link

doesn't look like it, I recently set up a new machine, and met the same issue.
I'd be genuinely surprised if microsoft cared about the quality of their products for once. this time isn't it though

@bi-an
Copy link

bi-an commented Oct 14, 2023

(gdb) b main
Breakpoint 1 at 0xe629: file /home/user/program/Src/UserMain.cpp, line 70.
(gdb) r
Starting program: /home/user/program/tester ./libTests.so
warning: opening /proc/PID/mem file for lwp 27519.27519 failed: No such file or directory (2)
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x800e610

(gdb)

same, wsl is:

PS C:\Users\user> wsl --status
Default Distribution: Ubuntu-22.04
Default Version: 2

and gdb is:

user@VM:~/$ gdb --version
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 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.

it's basically unusable. good job, microsoft. only installing gdb daily build from the PPA helps.

Yes, my environment is the same as yours. I installed the gdb daily build from the PPA as follows:

sudo add-apt-repository ppa:ubuntu-support-team/gdb
sudo apt update
sudo apt install gdb

It works!

@bi-an
Copy link

bi-an commented Nov 21, 2023 via email

@SunRTWang
Copy link

非常的好 兄弟sudo add-apt-repository ppa:ubuntu-support-team/gdb
sudo apt update
sudo apt install gdb 这样解决了

@bi-an
Copy link

bi-an commented Jun 29, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests