Setting break point using source code line number in WinDBG
Asked Answered
S

3

21

I am aware of setting breakpoint base on function name in WinDBG using bp, bm commands is there a way to set break point break on source code line number

say

 <some command> 20

means it should set breakpoint at line 20

Thanks in advance

Speciality answered 17/10, 2010 at 10:8 Comment(1)
Got the answer bp Recfib.c:9 set breakpoint at line 9 of Recfib.cSpeciality
C
40
bp `source.c:12`

Optionally, you can load the source file in WinDBG, set the cursor to the line you want to set a breakpoint to, and hit F9.

Also try .hh bp for more info

Caviar answered 11/12, 2010 at 20:52 Comment(1)
If anyone else is derping-out, see that you are using the quotation mark at the top left of the keyboard.Loriannlorianna
S
7

Here is the syntax for setting bp on line number

bp (@@masm(`main.c:8+`))

For the above to work .lines should be enabled

HTH

Surpass answered 17/10, 2010 at 14:6 Comment(0)
G
2

Here's the syntax:

bu `module_name!file.cpp:206`

Garwood answered 31/3, 2015 at 13:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.