Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting break point using source code line number in WinDBG

Tags:

windbg

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

like image 565
Vineel Kumar Reddy Avatar asked Oct 17 '10 10:10

Vineel Kumar Reddy


2 Answers

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

like image 185
Sonny Saluja Avatar answered Sep 20 '22 21:09

Sonny Saluja


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

like image 23
Naveen Avatar answered Sep 19 '22 21:09

Naveen