[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Debugger

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 10
Thread images: 1

File: 1490647085273.png (62KB, 480x270px) Image search: [Google]
1490647085273.png
62KB, 480x270px
I'd like to learn how to use a debugger since I'm learning C.
What are some good resources to learn how to use gdb/lldb (preferably the latter)?
>>
Nobody?
The tutorials I've found assume prior knowledge of debugging
>>
>>61342496
Use valgrind: valgrind --leak-check=full --show-reachable=yes ./a.out
>>
I just use xcode to step through my code :^)
>>
>>61342496
>debugger

How about you learn to program properly?
>>
Hacking the art of exploitation has a great intro in chapter 2 if i remember
>>
Debugging is conceptually very simple. You've got two major ideas to contend with:

- Breakpoints
- Stepping

Breakpoints are where you pre-select, before program execution, lines of code you want the program to pause on when it reaches them. When the program reaches those lines, it will stop and wait for your input. At this point you can check the state of the program, seeing what variables are in scope, what their values are, etc.

Stepping has two choices: step in and step over.

Stepping in will go into any functions you call, and line-by-line go through those functions. This can do down every level. Function 1 calls Function 2, which calls Function 3, and you can step into every one, see every line run. For C debugging, that can even mean going into code you don't have the source for, such as seeing some assembly representing what the Windows kernel is doing.

Stepping over will instead treat those function calls as a single line (this is most often what you want to be doing). It will still go line-by-line through your program, but remain at the level of abstraction you're already at, and pretend that function calls are the same as any statements.

If you find the concept of debugging confusing, an easy way to get used to it is probably setting up some simple JavaScript and running it in Chrome, using the Chrome dev tools to "debug" it, as it has the major operations you'll need in an easily-accessible GUI format, unlike C on Linux, which is all CLI shit. On Windows I guess you're using Visual Studio, which has a nice visual debugger, but you've got extra stuff to contend with like assembly, and actually trying to use C on Windows.
>>
>>61343306
retard
>>
>>61342496
All debuggers are more or less functionally equivalent. If you learn to use one you know how to basically use all of them. So if you don't know how to use a debugger at all, start with the GUI debugger integrated into any random IDE you pick. It's not complicated, you should be able to pick most of the things up with a couple google searches and simple trial and error. Everything will transfer over to gdb/lldb, which are just command line versions of the same thing.
>>
>>61342496
There's no better debugger than printf.
You guys know that I'm right.
Thread posts: 10
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.