Skip to main content

Posts

Showing posts from June, 2025

How to use gdb in Ubuntu Terminal

Here's a practical, minimal guide for using GDB in Ubuntu terminal — from launching to setting breakpoints and navigating your code. 🧰 Step 1: Compile with Debug Symbols Use -g and disable optimizations ( -O0 preferred for debugging): bash Copy Edit g++ -g -O0 -o myprog myprog.cpp 🚀 Step 2: Launch GDB bash Copy Edit gdb ./myprog You'll see a (gdb) prompt. 🎯 Step 3: Set Breakpoints You can set breakpoints in three main ways : ✅ a. At a function gdb Copy Edit (gdb) break main ✅ b. At a specific file and line gdb Copy Edit (gdb) break myprog.cpp:42 ✅ c. At a method in a class gdb Copy Edit (gdb) break MyClass::doSomething If the symbol is mangled (C++), GDB usually demangles automatically, especially if compiled with -g . ▶️ Step 4: Run the Program gdb Copy Edit (gdb) run 🧭 Step 5: Navigate Command Meaning next or n Step over current line step or s Step into function call finish Run until current function returns continue or c Continue until...

Wired vs Wifi usb multiplexer (chatGpt discussions)

Query: wired usb multiplexer vs wifi usb multiplexer for laptop ChatGPT said: Here’s a clear comparison of wired USB multiplexer vs Wi-Fi (wireless) USB multiplexer for use with a laptop — with focus on performance, reliability, latency, security , and use case suitability : 🔌 Wired USB Multiplexer (e.g. USB switch, USB sharer, or USB over IP via cable) ✅ Pros: Low Latency & High Speed : Offers native USB 2.0/3.0 speeds (up to 5-10 Gbps). Plug-and-Play : Generally no drivers or software needed. No Interference : Immune to wireless signal issues. Stable Power Delivery : Can reliably power USB devices (like cameras, storage). ❌ Cons: Limited Range : USB cables are typically limited to 2-5 meters. More Cables : Messier setup, especially in multi-device scenarios. Manual Switching (sometimes) : Cheaper models may require a physical button press to switch host access. 🧠 Suitable for: Latency-sensitive tasks (e.g. debugging, flashing firmware). H...

Eating/Consuming Kathal/ Jackfruit precautions (chatGpt discussions)

Query: Is "Kathal" n "Jack fruit" same? ChatGPT said: Yes, "Kathal" and "Jackfruit" are the same fruit . "Kathal" (कठल) is the Hindi name commonly used in India. "Jackfruit" is the English name. Scientific Info: Botanical name : Artocarpus heterophyllus Family : Moraceae (same family as mulberry and fig) Notes: It is the largest tree-borne fruit in the world. Eaten raw (as vegetable) when unripe (popular in Indian curries, biryani). Eaten ripe (as fruit) when yellow and sweet. Seeds are edible too (roasted, boiled, or in curries). If you're referring to them in any context—culinary, botanical, or grocery—they mean the same thing. You said: ripe jack fruit:"Kowa" How to eat? Various precautions based on scientific evidences, etc? Health benefits n side effects? Etc...? ChatGPT said: Ripe Jackfruit (called “Kowa” in some regions of India/Bangladesh): Full Guide Ripe jackfrui...