[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: windbg.png (74 KB, 1518x814)
74 KB PNG
>mogs every other debugger in existence
>>
Use case for debugging?
>>
>>109427921
>braindead
>>
File: 1785477508571675.jpg (101 KB, 396x385)
101 KB JPG
>>109427934
>>
Windows has excellent debuggers, it even has a kernel debugger you can set up by running 1 exe. Where's the same on Linux?
>>
>>109427921
script kiddies that believe doing things from a lower level of abstraction make them a 1337 anonymoos hacker
>>
Lel. Chrome or Firefox inspect mode is vastly superior to that.
>>
>>109427965
>yes please os give me access to read this file.
>please dont hate me os
>im a good process please reward me with more cpu time
A syscall normie said this.
>>
>using windbg when ghidra exists
ok
>>
>>109428109
Wake me up when Ghidra natively debugs NT kernel.
>>
>>109427907
looks like the gdb tui but it's a gui
>>
>>109427951
gdb just works

it mogs whatever toy this is in op's.
it supports kernel, hardware and veh debugging.

gdb lets you hook syscalls, plt calls, indirect calls, vmt calls, etc..
it also has it's own inline C interpreter to create new functions and inject them into existing code.
>>
>>109428112
it does. ghidra doesn't ship it's own debugger, instead it uses the nt debug api or any external debugger like llvm's debugger.
>>
>>109428278
Now show me how you set up remote kernel debugging with GDB
>>
File: 8a9.png (477 KB, 716x655)
477 KB PNG
I use CheatEngine to debug my own software
>>
>>109428290
"Claude, we're going to do some remote kernel debugging with gdb right now. Set it up for me."
Face it—AI replaces knowledge.
>>
>>109427965
>nobody should ever do anything low level because i dont understand it
web shitter detected
>>
>>109428290
(gdb) target remote ip:port

By default linux prevents debugging (security) so you have to enable it with a simple command, but that's it
>>
englightened (white) people use black UI

midwit dull (black) people use white UI

simple as that
>>
>>109427907
QEMU GDB is also nice in some cases
>>
>>109427921
>he doesn't debug and RE the software he uses
ngmi
>>
>>109427907
time travel debugger is extremely powerful (but it's only for the windbg preview which is a windows store app).
It will consumes gigs of ssd space if you leave it running for minutes, but the tdd.exe command line version lets you set a max size for the recording so it only records the recent history, and you can set a filter so that it only records the history of a specific module, so this is "usable" for a long running session.
Unfortunately it has an ugly scripting language required for powerful stuff since just using breakpoints / regular stepping isn't good enough, like finding the cause of a certain address that caused a fault.
But other than that, every debugger is the same, there is nothing special about windbg. If anything, it's inconvenient that I can't hover over variables to view the values, unlike any IDE.
If you were writing code, the only way to actually debug your code is with address sanitizer.
>>
>>109428286
>nt debug api
>i dont know anything about how nt is debugged
>>109428278
>it supports kernel, hardware and veh debugging.
Via serial text-based RSP protocol? No shit.
>>
>>109430129
yes, gdb can debug over uart too, linux has an interface to receive debug signals on uart ports
and gdb has builtin compatibility for it.

>nt debug api
i meant it supports the api for the nt debugger, whichever it is because i've never used it.
>>
>>109430302
>yes, gdb can debug over uart too, linux has an interface to receive debug signals on uart ports
>and gdb has builtin compatibility for it.
So does WinDbg
>>
>>109429956
>the only way to actually debug your code is with address sanitizer.

your code is just a clusterfuck bloatware (complicated). you get there because of many factors, like one of them is IDE but mostly the discipline, non modular design, threading model and other slop.

>every debugger is the same

every "modern" debugger may be the same (im not really into debuggers, as they are irrelevant for proper coding), but there was a time of SoftIce i remember, you didnt have to read any "reverse engineering" books at all, you could just make your own experiments, it was intuitive because it was a good black UI

--
btw, retards want to eat white bread, you know, they want to eat the bleaching agent, hehehe

nonono, SoftIce was a black soul
>>
>>109430364

address sanitizer ~ bleaching agent

you know, near, very near, i mean
>>
>>109430364
>asan
once you move away from baby toy projects, asan, ubsan, tsan, and the *grind suite can't even run properly.

it's already hard when you're just making text-based standard c programs, but anytime you use a vendored api, like directx, x11 or vulkan it's simply impossible to use these tools. they always report false positives. and vulkan icd makes all of them fail due to special memory maps used by some vendors.

I personally use debuggers in testing because I can deeply inspect stack, memory usage, allocation calls, system calls. I can inject random syscall/allocator failures in the middle of the code to see if the program terminates cleanly.
but of course any complex program makes this extremely hard. legitimately some of the software i built at work must have 20 test loc per program lines.
>>
>>109430458
>it's already hard when you're just making text-based standard c programs, but anytime you use a vendored api, like directx, x11 or vulkan it's simply impossible to use these tools. they always report false positives. and vulkan icd makes all of them fail due to special memory maps used by some vendors.
They have their own debuggers and diagnostics for that purpose.
>>
>>109430479
that's what we're using, it's ptrace based. we can simply recursively inspect a variable in memory and assert that the state holds invariants.

exposing the same through code would take 10x more work and be prone to errors.

the biggest downsides are latency, some programs are latency sensitive, or rather some bugs happen in debug mode, but not in release mode because latency changes. that's mostly due to some of the frameworks we use (dpdk) which relies on specific hardware.
>>
>>109430458
Debuggers are antiquated garbage—with AI you can just embed instrumentation directly into the code: clean—clear—concise. The answers you need when you need them. No muss. No fuss. No cruft. Just pin-point knowledge of program state.
>>
>>109427907
it was made before microsoft became an indian company
>>
>>109430671
Microslop became an Indian company when Windows became a thing.
>>
>>109430792
In 1985?
>>
>>109427907
It has MCP?
>>
>>109430558
>>109431010
AI slop non-programmers wrote this.
>>
>>109430458
>I can deeply inspect stack, memory usage, allocation calls, system calls.

you must see some T.Davis memory inspection procedures, hehehe.

dude, youre deep in the swamp, thats why you use a debugger, because you cannot transit states to the test in question in a few seconds, because your thing is so monolitic, it builds 20 minutes and the only way to get to the test is after clicking a mouse a hundred of times. that is why, not because "ama cool hacker inspecting the stack".. that stack is infested with exceptions and other binary safety crap by default.

:: disable frame pointer
:: used by bloatware like profilers and sanitizers
set OPT=%OPT% -fomit-frame-pointer
:: disable stack tinkertroonerism
set OPT=%OPT% -fno-asynchronous-unwind-tables
set OPT=%OPT% -fno-unwind-tables
:: disable __chkstk tranny before each stack increment
set OPT=%OPT% -mno-stack-arg-probe

>>
>>109431229
Lol. Software exceptions.
>>
File: Annotation 2026-04-18.png (19 KB, 514x349)
19 KB PNG
>>109427907
https://desuarchive.org/g/thread/108629045
>>
>>109431128
Luddite!
>>
File: planetwars.png (53 KB, 640x640)
53 KB PNG
>>109431229
>>109431418
>>109429956
>>109429037
>>109428776
>>109428299
>>109427979
>>109427965
>>109431738
desuarchive:
.org/g/thread/106861974
.org/g/thread/106843778
.org/g/thread/106554716
.org/g/thread/106015802
.org/g/thread/106375037
.org/g/thread/105155906
>>
>>109431738
>FUCKER GET ON THE GROUND
>I SAID NOW!
>HAND OVER THE ILLEGAL SOFTWARE SO WE CAN >DESTROY IT AS MANDATED BY GOVERNMENT ORDERS
>>
>>109435444
dead
>>
>>109427907
The Visual Studio debugger is considerably better for debugging your own code (or code for which you have the source available). obviously also better for C#.
WinDbg is only good in certain situations like where you have to debug really early in process initialization (e.g. debugging an AVRF provider or similar).
x64dbg or IDA is better for debugging third party code.
But yeah any Windows debugger is better than whatever command line slop Linux devs are using.
>>
>>109431738
>https://desuarchive.org/g/thread/108629045
https://pixel<cut>drain.com/u/ddx4whTQ
>>
>>
>>109428776
you're indian, though.
>>
>>109435643
Glad you enjoyed. This is the average American experience.
>>
>>109427907
Ok then if it's so good and better than x96dbg how do i debug a bug in a game that causes regular stutter?(spikes to approx 8-10ms on a good cpu, worse cpus get more than 50ms, happens around 2 times per second)
I've pinpointed it to a semaphore handle the main thread waits on, removing the wait just makes all cpu cores be 100% used and somehow worsens the stutter if the game windows is focused but improves them if focused.
The game has anti static analysis tricks(encrypted exe + (un?)intentionally corrupts PE header after decryption) and instantly quits if a debugger mauses the process, but you can explore and change code in the debugger fine for some reason
>>
>>109436998
The stutters improve if unfocused*
>>
>>109428278
AT&T syntax evangelist(more like satanist) who never used the software he claims is the best
Let me guess, next time you'll be saying it didn't take almost a decade for GNOME to support refresh rates over 60hz and KDE x11's kwin isn't a stuttery buggy piece of shit
>>
>>109437035
i use both syntax. intel is better for reading, but writing is better on att because access is specified in the operator, instead of operands, just like most languages.

don't know why you're talking about gnome. i've never used it, maybe it lives rent free inside your head.
>>
>>109428109
>installing anything NSA made on your machine
ngmi
>>
>>109428278
You can never quiesce a running linux system enough make most of that stuff worthwhile.
>>
>>109437440
I use intel syntax on intel processors.
Weird, huh?
>>
>>109440256
>256
>>
>>109427921
>Use case for debugging?
20 years ago when I was writing a lot of C, I used it to debug segfaults. You can't rely on printf debugging when your program crashes before it can flush the output buffer. If I were writing the same code now, I probably wouldn't need the debugger as much because I'd either write defensively enough to avoid segfaults, or else pretty quickly be able to guess where the mistake was.

Either way, a step debugger helps massively being able to watch memory and see the exact line where the memory value is wrong.

>>109428278
>gdb just works
Casey Muratori summarized the problem with this argument superbly in the standup podcast when they had Ryan Fleury (main author of Rad Debugger) on as guest.
"Just works" is a completely useless standard for a debugger. That a debugger "works" is irrelevant if manually instrumenting your code with debug output is faster and more effective method of troubleshooting.
>>
File: fedora-guy.jpg (50 KB, 479x720)
50 KB JPG
>>109442825
>You can't rely on printf debugging when your program crashes before it can flush the output buffer.
no, you cant
but if you use
fprintf(stderr, fmt, ...);

it does immediately flush.
>>
>>109442897
>fprintf(stderr
this print non synchronized with normal output so useless
>>
x64dbg exists
>>
>>109443005
yeah, because it outputs to standard error when you ask it to
then it flushes immediately

ur moms useless for leaving you with a life-threatening deficiciencies in getting slapped across the face
thats insanely irresponsible of her
>>
>>109443029
by default printf flushes at line end
>>
>>109443171
i dont think so
debugging with printf did bite me in the ass.
on linux as well as on macos.
i wont die on that hill though, it was ages ago, and i learned my lesson pretty quick
im fairly certain i was using newlines though
>>
$|++; # disable print buffer for perl
>>
>>109427907
I heard it called “wind bag” the other day and nearly lost it.
It’s Win D B G right??
>>
>>109443318
x64dbg
>>
>>109442825
>>109442897
>>109443029
>>109443318
use tcc.exe, it disables segfaults
https://desuarchive.org/g/thread/108690362
>>
>>109443403
ok
but i do like my segfaults though
>if you fail, best to fail fast, and fail loudly
>>
>>109443428
segfault it is slow fall
>>
>>109444247
im not sure how seg is slow to fail

what do you have in mind?
tcc fails differently?
>>
>>109444335
segfault can change some random variable in same segment and program falls after 5 hours when it become important
>>
>>109444348
aaah
thats not a segfault proper though
segfault is linked with attempting to access a memory space your process isnt supposed to

what youre talking about is out of bounds writes
a seg is an out of bounds, but not all of out of bounds are segs
sometimes you write within your program, but in an uninteded location, (out of bounds- the error you describe) as opposed to writing in an unintended location, but *outside your program (thats a proper seg)
(can also be an attempt to write to a read only page in your program, but thats minutia)

and valgrind solves for that. kinda.
if you shove your stuff in an arena no analyzer will be able to see through your error because youre writing in legal memory spaces you created as far as theyre concerned
which i dont think even tcc can solve
>>
>>109444417
>tcc.exe can solve
yes, he can
>>
https://desuarchive.org/g/thread/108770946
tcc.exe and raylib.dll tread
>>
>>109444429
nah, not when writing within an arena
brush up your basics. you already proved you dont know what a seg is, it stands to reason you dont know how an arena works
namely:
you allocate a slab (thence its also known as slab allocator), and then you pass pointers to spaces within that slab
problem is: your slab is a legal memory space to write to
if you make a mistake while writing to one, that looks like a legal operation to any debugger (as long as you dont write outside of it)

without a system of contracts/traits you cannot discern that that was a mistake
c does not provide such a system
>>
>>109444464
its runtime checks
>>
>>109444496
so its runtime phantom conditionals.
i will not be using tcc. i have something around 400klocs of c under my belt
>>
>>109444591
so they will fire (You) and hire tcc.exe professional
>>
>>109444785
nah
tcc is gonne get shat on as it currently is
a) because its "professionals" dont even know what a seg, or an arena is
b) because its a toy project that takes python, and c, smooshes em together to end up with a gimped c that larps as python, but with a fraction of the guarantees

also employement in programming is for idea-less losers who cannot function if they arent micromanaged as to what to do
>>
>>109444804
sound cool, there your papers, now f-ck off my office
>>
>>109444823
...
thats a newspaper and youre sitting on a park bench.
anyhoo, ill leave you to your devices
>>
>>109429956
last time i tried time travelling debugging i was cucked by AMD
is it still unsupported on AMD?
>>
>>109444979
wait shit that was record and replay nvm
>>
>>109434531
also this
>>
>>109427907
It's the biggest piece of shit EVER
>>109430458
Are Linux and Chromium toy projects? They make use of ASAN extensively.
>>
>>109430458
>it's already hard when you're just making text-based standard c programs, but anytime you use a vendored api, like directx, x11 or vulkan it's simply impossible to use these tools. they always report false positives. and vulkan icd makes all of them fail due to special memory maps used by some vendors.
I have no problem using them with my Vulkan game engine.
>>
>>109445577
>Chromium
Chromium just kill all process with page, dont even try to free memory
>>
just use tcc.exe, it disables segfaults
https://desuarchive.org/g/thread/108690362
>>
>>109445577
asan was made by google, so they made chrome compatible.

what I meant is that every icd calls breaks asan. asan also doesn't support avx512. and asan also has an impact on timings, if your software has timing sensitive bugs (e.g dpdk networking) then asan doesn't help.
>>
>>109445706
Chromium just kill all process with page, dont even try to free memory
>>
>>109445706
>asan was made by google, so they made chrome compatible.
Literally every major web browser has the option to build with address sanitization enabled. Their unit tests depend on asserts and address sanitization to detect memory corruption bugs.
>and asan also has an impact on timings, if your software has timing sensitive bugs (e.g dpdk networking) then asan doesn't help.
ASAN is used to find memory corruption bugs first and foremost. There are other projects aiming to build a data race sanitizer like ThreadSanitizer.
>>
>>109444464
I just felt the need to mention that segs are not real in in 64bit x86.
in 16 and 32bit x86, there are segment registers, and they still "exist" in x64, but they are set to 0 or repurposed (for exception handling/thread local storage).
It's all just pages, the "segments" in a binary (aka the memory chunks in an image chopped into executable+read-only or read-only or writeable) are aligned to the page size.
TCC has segfaults that you would expect with 4kb pages. It also has a primitive -b bounds checking for fixed sized arrays I assume (not very useful since it's easily broken by simple functions like fread or memcpy which are not checked, asan will check those functions, and generally when I have arrays, I use malloc which wont check bounds in tcc).
In the future there will be ChkTag for x86 on intel nova / zen 6. It will allow the binary to "run" on older x86 cpu's (it uses the unused pointer bits, which are ignored on older CPU's, but no checking will be done). But it has not been finalized yet, and you need a compiler to support it. It will probably take a year or more. It probably won't replace asan because most projects have custom allocators which require custom poisoning, and I bet ChkTag will not support custom poisoning, just like arm's MTE (but ChkTag seems like it will have a per-byte checking, unlike MTE's 16byte granule which only checks the full chunk).



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

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.