microsoft / microsoft/WSL

gdb not able to debug

Open
#8,516 42 comments 0 reactions 0 assignees View on GitHub
wsl1
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

### Version

Microsoft Windows [版本 10.0.19042.1706]

### WSL Version

- [ ] WSL 2
- [X] 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_

Contributor guide

Open the contributing guide

Research direction

Reproduce the report in WSL 1 with Ubuntu-22.04 using the shown gcc and gdb commands, starting from test.c and the generated a.out. Inspect the /proc/PID/mem warning and breakpoint failure, then compare the behavior with the issue's 42 comments. Done means gdb can set and hit the main breakpoint for the stated reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux, ubuntu
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.