Learn the lldb debugger basics in 11 minutes | 2021 (Also works on M1 Apple Silicon)

  Переглядів 33,884

Mike Shah

Mike Shah

День тому

►GDB tutorial here: ukposts.info?v=MTkDTj...
►Find full courses on: courses.mshah.io/
►Join as Member to Support the channel: / @mikeshah
►Lesson Description: Note: One other very useful command is 'display' which I did not cover. You can inspect symbols in scope and see their value.
Here's a mapping of GDB to lldb commands if you are more familiar with gdb: lldb.llvm.org/use/map.html
00:00 Introduction to LLDB debugger
00:55 LLDB website
1:26 Sample code for the lesson
1:51 Compiling with debugging symbols
2:40 creating a target process
3:00 help in lldb
3:27 Finding our bug
4:08 creating a breakpoint
5:16 stepping to next instruction and moving to next command
6:40 Viewing the backtrace, i.e., our call stack
7:40 Navigating the graphical interface
8:48 relaunching our process and running through GUI
10:14 Fixing our segmentation fault
10:58 Wrapping up
►UKposts Channel: / mikeshah
►Please like and subscribe to help the channel!
►Join our free community: courses.mshah.io/communities/...

КОМЕНТАРІ: 56
@stavb9400
@stavb9400 Рік тому
The 11 minutes I did not know I needed , great job
@MikeShah
@MikeShah Рік тому
Cheers!
@user-oj4yl4tf6b
@user-oj4yl4tf6b Рік тому
I don't know if gdb or pdb has this kind of easy to use tools.If they have, it will make a step further for me to debug cpp or py programs.Since in the GUI format, we can see the entire debugging process more clearly.Thanks guy, you open a new door to me.
@HeiderSati
@HeiderSati Рік тому
LLoved it, great tutorial, I was looking for the r and n shortcuts on GUI and yours really helped, thanks million :)
@MikeShah
@MikeShah Рік тому
Cheers!
@apprenticerocker9885
@apprenticerocker9885 Рік тому
Thank you very much, I’m trying to jump from web programming to system programming and I really needed a clear and easy introduction to LLDB.
@MikeShah
@MikeShah Рік тому
You are most welcome!
@jinhuang7258
@jinhuang7258 8 місяців тому
OMG, thank you......I spent my entire morning trying to find out why gdb failed on the UTM Ubuntu Linux on my Apple M1.....It was so frustrating. Then I found your video and lldb worked perfectly.,...Thank you!
@MikeShah
@MikeShah 8 місяців тому
Cheers!
@fortphoenix
@fortphoenix Рік тому
Very helpful tutorial! Thanks a ton!
@MikeShah
@MikeShah Рік тому
Thank you for the kind words!
@samjudelson
@samjudelson 3 місяці тому
This is a great introduction to LLDB, thank you!
@MikeShah
@MikeShah 3 місяці тому
Thank you!
@cindaellas
@cindaellas Місяць тому
very good tutorial! thank you very much!🙌
@roger9822
@roger9822 2 роки тому
Thank you, really illustrative!
@MikeShah
@MikeShah 2 роки тому
Thank you for the kind words! 🙂
@sjb8178
@sjb8178 Рік тому
this is freaking beautiful
@MikeShah
@MikeShah Рік тому
Cheers!
@DanelonNicolas
@DanelonNicolas 8 місяців тому
good stuff! thanks!
@MikeShah
@MikeShah 8 місяців тому
Cheers!
@cyogerenkundibiza5284
@cyogerenkundibiza5284 Рік тому
Thank you so much for such a great video. How do you show the source code instead of assembly code. Basically, in my case after the run command, the whole process is showing in assembly only. I would like to show the source code instead. I couldn't find any help on the lldb website.
@MikeShah
@MikeShah Рік тому
Can always use 'l' (lower case L) to list the source code. If you mean in the GUI, try going to @7:40 and following along. My guess is you did not compile your code with '-g' to insert debugging symbols.
@oleholgerson3416
@oleholgerson3416 2 роки тому
Thanks very helpful. Did you by any chance try out clang modules in lldb? Debugging C++ with libc++ is very annoying. I was hoping that clang modules can help there
@MikeShah
@MikeShah 2 роки тому
By modules do you mean c++20 modules debugging? Or perhaps some other debugging feature?
@user-by8kc3zm1n
@user-by8kc3zm1n Рік тому
Thanks for your tutorial!
@MikeShah
@MikeShah Рік тому
Cheers!
@ziliangchen7111
@ziliangchen7111 Рік тому
Nice intro, thanks ! May i ask if lldb supports setup breakpoint only for a specific thread (conditionally) ? Like in GDB `b file.cpp:30 thread 4` which only pauses at the breakpoint in thread 4.
@MikeShah
@MikeShah Рік тому
Can try in lldb, and I think this is supported using the python lldb api, but not sure of the command off the top of my head.
@ziliangchen7111
@ziliangchen7111 Рік тому
@@MikeShah Thanks. I googled around, look like there is no direct builtin command for that. Will explore python lldb API.
@MikeShah
@MikeShah Рік тому
@@ziliangchen7111 cool, let me know what you find!
@joshchartrand8464
@joshchartrand8464 Рік тому
Great video!
@MikeShah
@MikeShah Рік тому
Thank you for the kind words 🙂
@josephherrera639
@josephherrera639 2 роки тому
Great video! Is there anyway to not have the prompt keep asking you to give permissions to files whenever you "run" LLDB?
@MikeShah
@MikeShah 2 роки тому
I'm assuming you're asking about 3:13? There appears to be some workarounds in the privacy & security settings here: developer.apple.com/forums/thread/110423 Otherwise, I was not running as a super user which may have been the problem.
@MikeShah
@MikeShah 2 роки тому
Note: Should always use care when running as super user!
@josephherrera639
@josephherrera639 2 роки тому
Ah, right! Apple can be a pain sometimes. I'll just stick to this and accept the prompt. Thanks again!
@dmitryponyatov2158
@dmitryponyatov2158 Рік тому
How can I intergate lldb with VSCode and maybe some other external tools like Wireshark to debug low-level networking code (in Rust) ? I googled some time, can can't find any VSCode extension able to show network traffic in an app started in debug mode, excepts one able to view recorded traffic files but not a realtime run.
@MikeShah
@MikeShah Рік тому
I don't use VSCode often, but I imagine there is an integration. Otherwise, lldb can be used from the console window. I haven't used wireshark in years either, perhaps there are some integrations as well.
@vibhatha
@vibhatha 2 роки тому
Really nice presentation 👏👏👏
@MikeShah
@MikeShah 2 роки тому
Thank you for the kind words!
@VoidloniXaarii
@VoidloniXaarii 7 місяців тому
Thankx for this insight into Mac programming that I never had. 2 stupid me looks very Linux ish. Was very curious because of the old I'd software doom biographies where I got the impression of Mac/nextos backgrounds that seemed so distantly magical to me
@MikeShah
@MikeShah 7 місяців тому
Cheers! lldb really works well with the clang compilers (which Mac seems to be supporting)
@VoidloniXaarii
@VoidloniXaarii 7 місяців тому
@@MikeShah clang is in general such a mystery to me... How can they be so so good?
@MikeShah
@MikeShah 7 місяців тому
@@VoidloniXaarii Tooling infrastructure for modular frontend (lexer, parser, etc.), optimizer (on the intermediate LLVM bitcode), and backend (Code generation) I think has made a big difference. Allows for more engineers to work in the code. It's evolved into something quite massive, but still is probably the best default for language and toolbuilding.
@VoidloniXaarii
@VoidloniXaarii 7 місяців тому
@@MikeShah I would not have been so surprised to see such excellentce in gcc or Microsoft compiler, but that it showed up in a less expected made me wonder who the powers/ppl behind it were
@RTBURGAZ
@RTBURGAZ 3 місяці тому
thank you very much!
@MikeShah
@MikeShah 3 місяці тому
You are most welcome!
@xarax7950
@xarax7950 2 місяці тому
THANKS !
@MikeShah
@MikeShah 2 місяці тому
Cheers!
@shuklashravan
@shuklashravan Рік тому
very well explained
@MikeShah
@MikeShah Рік тому
Cheers!
@realdragon
@realdragon 19 днів тому
_Lost debug server connection_
@justsurajp
@justsurajp Рік тому
Hint: Once can use "frame" or "f" instead of "list " to view the current frame. PS: Thanks for the tutorial, it helped! :)
@MikeShah
@MikeShah Рік тому
Cheers, you are most welcome!
@martinliza4811
@martinliza4811 10 місяців тому
Thank you for this video it was very helpful! By any chance do you use an ~/.lldbint If sou, could you share it ?! Thank you :D
@MikeShah
@MikeShah 10 місяців тому
Cheers! I don't use one at this time
GDB Tutorial
55:12
CS 246
Переглядів 60 тис.
Піхотинець - про рутину на фронті
00:46
Суспільне Новини
Переглядів 1,2 млн
ISSEI funny story😂😂😂Strange World | Magic Lips💋
00:36
ISSEI / いっせい
Переглядів 109 млн
Маленькая и средняя фанта
00:56
Multi DO Smile Russian
Переглядів 1,9 млн
CppCon 2016: Greg Law “GDB - A Lot More Than You Knew"
59:09
Quick and Dirty LLDB: All you need in 5 minutes.
6:22
Hollywood Modern Yoyos
Переглядів 26 тис.
you need to stop using print debugging (do THIS instead)
7:07
Low Level Learning
Переглядів 393 тис.
DEBUG in Neovim. Like a BOSS.
9:44
DevOps Toolbox
Переглядів 42 тис.
everything is open source if you can reverse engineer (try it RIGHT NOW!)
13:56
Low Level Learning
Переглядів 1,2 млн
GDB is REALLY easy! Find Bugs in Your Code with Only A Few Commands
7:29
Low Level Learning
Переглядів 184 тис.
you can become a GIGACHAD assembly programmer in 10 minutes (try it RIGHT NOW)
9:48
Debugging 101: Replace print() with icecream ic()
12:36
NeuralNine
Переглядів 348 тис.
Drone Programming With Python Course | 3 Hours | Including x4 Projects | Computer Vision
3:33:03
Murtaza's Workshop - Robotics and AI
Переглядів 6 млн
How to configure Debuggers in Neovim | FREE COURSE // EP 6
13:40
typecraft
Переглядів 37 тис.
Он Отказался от БЕСПЛАТНОЙ видеокарты
0:40
ЖЕЛЕЗНЫЙ КОРОЛЬ
Переглядів 1,6 млн
поворотний механізм для антени
0:17
Lazeruk
Переглядів 14 тис.
Индуктивность и дроссель.
1:00
Hi Dev! – Электроника
Переглядів 102 тис.
Радиоприемник из фольги, стаканчика и светодиода с батарейкой?
1:00