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

Vineel Kumar Reddy
  • 4,588
  • 9
  • 33
  • 37

3 Answers3

39
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

Abyx
  • 12,345
  • 5
  • 44
  • 76
Sonny Saluja
  • 7,193
  • 2
  • 25
  • 39
  • 3
    If anyone else is derping-out, see that you are using the quotation mark at the top left of the keyboard. – Elliot Nov 06 '18 at 16:04
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

Naveen
  • 4,092
  • 29
  • 31
2

Here's the syntax:

bu `module_name!file.cpp:206`

pmakowski
  • 21
  • 2