GDB Server stopOnEntry broken on embedded systems
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- devtools, embedded-iot
Research direction
Read src/MIDebugEngine/Engine.Impl/DebuggedProcess.cs around lines 1148-1161 and inspect the EntryPointHit and HandleBreakModeEvent logic. Compare related issues #1108 and #1109, then determine how GDB Server attach breaks should be distinguished on embedded targets. Done means the entry breakpoint is not deleted before it is hit.
Written by the indexing model from the issue text.
Description
GDB servers will always halt execution when the GDB Client attaches. MIEngine attempts to mask this through the EntryPointHit logic in HandleBreakModeEvent. #557 adds a heuristic to determine whether the break event is caused by this attach halt by checking whether the break event occurs inside a file:
On embedded systems, the target will always be somewhere when the client starts the GDB server, so the "file" field is virtually always populated, even if the target is just halted at the start of its reset procedure. This breaks the "file" heuristic in the snippet above, and the entry breakpoint is deleted before it's hit.
This file based heuristic appears to be an inaccurate way to determine whether the break event is related to attach.
I'd be happy to make a PR with a fix, but I think there are multiple approaches here, and I don't really know which one would be appropriate:
- Remove the file based heuristic altogether, and always skip break events without a reason field before the entry point when launching with a server.
- Add a member flag that forces the debugger to skip this first break event when launching with a GDB Server instead of looking at the file field
- Add some special handling for embedded systems, as their environment is a little different.
Related issues and PRs:
- Dominant language
- C#
- Stars
- 859
- Forks
- 233
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 3
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/MIEngine
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
question
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
All issues in microsoft/MIEngine
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·