[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-571743-105":53,"doc-detail-571743-en":126},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":119,"head_meta":121,"extra_data":123,"updated_unix":125},105,"en","gdb-cheatsheet-quick-reference","GDB Cheatsheet - Quick Reference","","GDB cheatsheet provides a compact set of common GNU Debugger commands for day-to-day debugging. It covers starting and attaching to programs (including core dumps), controlling execution flow, and managing breakpoints and watchpoints with optional conditions. It also includes stack inspection with backtrace and frame selection, step/next/finish/continue controls, examining variables and memory, supported data formats, thread selection, source listing, handling signals, and key information queries such as breakpoints, locals, threads, and shared libraries.",{"@graph":63,"@context":118},[64,80,101],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/gdb-cheatsheet-quick-reference/571743/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/gdb-cheatsheet-quick-reference/571743.png","ImageObject",442,249,{"name":88,"@type":89},"Cipher","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-22","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":79},"InteractionCounter",{"@type":100},"ViewAction",{"@type":102,"mainEntity":103},"FAQPage",[104,110,114],{"name":105,"@type":106,"acceptedAnswer":107},"How do I start GDB with a program and optional core dump?","Question",{"text":108,"@type":109},"Use `gdb \u003Cprogram> [core dump]` to start GDB with an optional core dump. You can also start with arguments via `gdb --args \u003Cprogram> \u003Cargs…>`.","Answer",{"name":111,"@type":106,"acceptedAnswer":112},"How can I set, remove, enable, or disable breakpoints and watchpoints?",{"text":113,"@type":109},"Use `break \u003Cwhere>` to set a breakpoint and `delete \u003Cbreakpoint#>` to remove it. Use `enable \u003Cbreakpoint#>` and `disable \u003Cbreakpoint#>` to change breakpoint state. Watchpoints use `watch \u003Cwhere>`, and you can delete/enable/disable them similarly.",{"name":115,"@type":106,"acceptedAnswer":116},"How do I inspect memory and variables in GDB?",{"text":117,"@type":109},"Use `print/format \u003Cwhat>` to print variables or memory locations/registers and `display/format \u003Cwhat>` to repeat printing after each stepping instruction. For memory, use `x /nfu \u003Caddress>`, where `n` controls units, `f` controls format, and `u` selects the unit size.","https://schema.org",{"og:url":78,"og:type":120,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":122,"canonical":78},"index,follow",{"doc_id":124,"site_id":56},571743,1792360022,{"code":4,"msg":5,"data":127},{"doc_id":124,"user_id":128,"nickname":88,"user_avatar":129,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":130,"file_id":131,"file_url":132,"file_type":133,"file_size":134,"view_count":79,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":73,"language":135,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":136,"faqs":137,"seo_title":138,"seo_description":61,"update_tm":139,"read_time":9},687208528416,"https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc","GDB cheatsheet-page 1  \nRunning  \n\\# gdb \u003Cprogram> [core dump]  \nStart GDB (with optional core dump) .  \n\\# gdb--args \u003Cprogram> \u003Cargs…> Start GDB and pass arguments  \n\\# gdb--pid \u003Cpid>  \nStart GDB and attach to process.  \nset args \u003Cargs . ..>  \nSet arguments to pass to program tobe debugged.  \nrun  \nRun the program to be debugged. kill  \nKill the running program.  \nBreakpoints  \nbreak \u003Cwhere>  \nSet a new breakpoint. delete \u003Cbreakpoint\\#>  \nRemove a breakpoint. clear  \nDelete all breakpoints. enable \u003Cbreakpoint\\#>  \nEnable a disabled breakpoint.  \ndisable \u003Cbreakpoint\\#> Disable a breakpoint.  \nWatchpoints  \nwatch \u003Cwhere>  \nSet a new watchpoint.  \ndelete/enable/disable \u003Cwatchpoint\\#> Like breakpoints.  \n\u003Cwhere>  \nfunction name  \nBreak/watch the named function.  \nline number  \nBreak/watch the line number in the current source ﬁle.  \nfile:line number  \nBreak/watch the line number in the named source ﬁle.  \nConditions  \nbreak/watch \u003Cwhere> if \u003Ccondition> Break/watch at the given location if the condition is met.  \nConditions may be almost any C expression that evaluate to true or false.  \ncondition \u003Cbreakpoint\\#> \u003Ccondition> Set/change the condition of an existing break-or watchpoint.  \nExamining the stack  \nbacktrace where  \nShow call stack.  \nbacktrace full where full  \nShow call stack, also print the local variables in each frame.  \nframe \u003Cframe\\#>  \nSelect the stack frame to operate on.  \nStepping  \nstep  \nGo to next instruction (source line), diving into function.  \n© 2007 Marc Haisenko \u003C[marc@darkdust.net](marc@darkdust.net)>  \nnext  \nGo to next instruction (source line) but donʻt dive into functions.  \nfinish  \nContinue until the current function returns.  \ncontinue  \nContinue normal execution.  \nVariables and memory  \nprint/format \u003Cwhat>  \nPrint content of variable/memory location/register.  \ndisplay/format \u003Cwhat>  \nLike „print“, but print the information after each stepping instruction.  \nundisplay \u003Cdisplay\\#>  \nRemove the „display“ with the given number.  \nenable display \u003Cdisplay\\#> disable display \u003Cdisplay\\#>  \nEn-or disable the „display“ with the given number.  \nx /nfu \u003Caddress>  \nPrint memory.  \nn: How many units to print (default 1) .  \nf: Format character (like „print“) .  \nu: Unit.  \nUnit is one of:  \nb: Byte,  \nh: Half-word (two bytes)  \nw: Word (four bytes)  \ng: Giant word (eight bytes)) .  \nGDB cheatsheet-page 2  \nFormat  \na Pointer.  \nc Read as integer, print as character.  \nd Integer, signed decimal.  \nf Floating point number.  \no Integer, print as octal.  \ns Try to treat as C string.  \nt Integer, print as binary (t = „two“) .  \nu Integer, unsigned decimal.  \nx Integer, print as hexadecimal.  \n \u003Cwhat>   \nexpression  \nAlmost any C expression, including function calls (must be preﬁxed with a cast to tell GDB the return value type) .  \nfile name :: variable name  \nContent of the variable deﬁned in the named ﬁle (static variables) .  \nfunction :: variable name  \nContent of the variable deﬁned in the named function (if on the stack) .  \n{type}address  \nContent at address, interpreted as being of the C type type.  \n$register  \nContent of named register. Interesting registers are $esp (stack pointer), $ebp (frame pointer) and $eip (instruction pointer) .  \nThreads  \nthread \u003Cthread\\#>  \nChose thread to operate on.  \nManipulating the program  \nset var \u003Cvariable name>= \u003Cvalue> Change the content of a variable to the given value.  \nreturn \u003Cexpression>  \nForce the current function to return immediately, passing the given value.  \nSources  \ndirectory \u003Cdirectory>  \nAdd directory to the list of directories that is searched for sources.  \nlist  \nlist \u003Cfilename> :\u003Cfunction>  \nlist \u003Cfilename> : \u003Cline number>  \nlist \u003Cfirst>,\u003Clast>  \nShows the current or given source context. The ﬁlename may be omitted. If last is omitted the context starting at start is printed instead of centered around it.  \nset listsize \u003Ccount>  \nSet how many lines to show in „list“.  \nSignals  \nhandle \u003Csignal> \u003Coptions>  \nSet how to handle signles. Options ar","cbCaiakfiyoOqLaF","https://ap.wps.com/l/cbCaiakfiyoOqLaF","pdf",73935,"English","# Running\n## Breakpoints and Watchpoints\n# Conditions\n# Examining the stack\n# Stepping\n# Variables and memory\n# Format\n# Threads\n# Manipulating the program\n# Sources\n# Signals\n# Informations","[{\"question\":\"How do I start GDB with a program and optional core dump?\",\"answer\":\"Use `gdb \\u003cprogram\\u003e [core dump]` to start GDB with an optional core dump. You can also start with arguments via `gdb --args \\u003cprogram\\u003e \\u003cargs…\\u003e`.\"},{\"question\":\"How can I set, remove, enable, or disable breakpoints and watchpoints?\",\"answer\":\"Use `break \\u003cwhere\\u003e` to set a breakpoint and `delete \\u003cbreakpoint#\\u003e` to remove it. Use `enable \\u003cbreakpoint#\\u003e` and `disable \\u003cbreakpoint#\\u003e` to change breakpoint state. Watchpoints use `watch \\u003cwhere\\u003e`, and you can delete/enable/disable them similarly.\"},{\"question\":\"How do I inspect memory and variables in GDB?\",\"answer\":\"Use `print/format \\u003cwhat\\u003e` to print variables or memory locations/registers and `display/format \\u003cwhat\\u003e` to repeat printing after each stepping instruction. For memory, use `x /nfu \\u003caddress\\u003e`, where `n` controls units, `f` controls format, and `u` selects the unit size.\"}]","GDB Cheatsheet - Quick Reference | PDF",1791923525]