[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-571747-105":53,"doc-detail-571747-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-fall-2019","gdb Cheatsheet - Fall 2019","","A concise reference for debugging CSCI0330/CS33-style programs with GDB during Fall 2019. The sheet explains how to launch GDB with an executable, reminds users to recompile after changes, and lists a compact set of essential GDB commands. Included entries cover window/layout control, breakpoint creation and removal, conditional breakpoints, querying breakpoint and argument information, program run/continue/step-next behavior, stack tracing and frame navigation, quitting, expression printing, and memory examination formats and units.",{"@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-fall-2019/571747/",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-fall-2019/571747.png","ImageObject",442,249,{"name":88,"@type":89},"Stanley","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-22","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":47},"InteractionCounter",{"@type":100},"ViewAction",{"@type":102,"mainEntity":103},"FAQPage",[104,110,114],{"name":105,"@type":106,"acceptedAnswer":107},"How do you start GDB for a program?","Question",{"text":108,"@type":109},"Run gdb with the executable path and optional arguments: gdb ./executable [arguments].","Answer",{"name":111,"@type":106,"acceptedAnswer":112},"What GDB commands are used for breakpoints and conditional breakpoints?",{"text":113,"@type":109},"Use break \u003Clocation> to set a breakpoint, delete \u003Cbreakpoint #> to remove it, and condition \u003Cbreakpoint #>\u003Ccondition> to make a breakpoint hit only when the condition is true.",{"name":115,"@type":106,"acceptedAnswer":116},"How can you inspect memory and view a stack trace in GDB?",{"text":117,"@type":109},"Use x/\u003Cnumber>\u003Cformat>\u003Cunit_size> \u003Caddress> to examine memory at an address with specified formatting and data size. Use backtrace (or the listed back[t]race command) to print a stack trace of functions and arguments.","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},571747,1792360023,{"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":47,"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},2336477405376,"https://ap-avatar.wpscdn.com/davatar_29158cc5080c5b710cf443261637dec0","CSCI0330 Intro Computer Systems Doeppner  \ngdb Cheatsheet  \nFall 2019  \n1 Introduction  \nThis document contains a short list of gdb commands to help you debug your cs33 programs. The commands contained within this document are by no means exhaustive. Consult the GDB guide, the man pages (man gdb) or the internet if you require further information.  \nHow to run gdb: gdb ./executable [arguments ]  \nBe sure to recompile your program every time you make changes.  \n2 GDB Commands  \nFor each of the following commands, bolded text is required (commands and arguments) ,  \nsquare brackets are shortcuts, and angle brackets are arguments (non bold ones are optional) .  \n\n| layout \u003Cwindow> | Opens a terminal interface that displays the source file while debugging. The \u003Cwindow> can either be src to display C code, asm for assembly, or regs for registers. |\n| --- | --- |\n| focus \u003Cwindow> | Switches focus between windows. The \u003Cwindow> parameter can be those supplied to layout or cmd to change focuns to the command window. |\n| [b]reak \u003Clocation> | Sets a breakpoint on either a function, a line given by aline number, or the instruction located at a particular address. The \u003Clocation> can be a function name or filename:line\\# or *memory address. |\n| [d]elete \u003Cbreakpoint \\#> | Removes the indicated breakpoint. To see breakpoint numbers, run info break, or i b. |\n| [cond]ition \u003Cbreakpoint \\#>\u003Ccondition> | Updates the breakpoint indicated by the given number so that it’s only hit if condition is true. condition is expressed in C syntax, and can use variables and functions that are in the scope of the breakpoint. |\n| [i]nfo \u003Cabout> | Lists information about the argument (about) , or lists what possible arguments are if none are provided. |\n\nCSCI0330 gdb Cheatsheet Fall 2019  \n\n| [ r ]un \u003Carg1 arg2 . . . argn> | Runs the loaded executable program with program arguments arg1 . .. argn. |\n| --- | --- |\n| [c ]ontinue | Resumes execution of a stopped program, stopping again at the next breakpoint. |\n| [ s ]tep[i] or\u003Cbr>[ n ]ext [i] | Steps through a single line of code. step steps into function calls while next skips over them. If i is provided, steps over a single instruction as opposed to aline. |\n| [b]ack [t]race | Prints a stack trace, listing each function and its arguments. This does the same thing as the commands info stack and where. |\n| [f]rame \u003C number> or up or\u003Cbr>down | frame switches context to a previous frame indexed by \u003C number> . To see a list of the current stack frames, use backtrace. up goes up one frame, and down goes down one frame. (especially helpful when using layout) |\n| [q]u it | Quits gdb. |\n| [p]r int \u003Cexpression> | Prints the value which the indicated expression evaluates to. There are various formatting arguments to change how print outputs things. |\n| [x ]/\u003C number>\u003Cformat>\u003C unit_size> \u003Caddress> | Examines the data located in memory at address.\u003Cbr>● number optionally indicates that several contiguous elements, beginning at address, should be examined. This is very useful for examining the contents of an array. By default, this argument is 1.\u003Cbr>● format indicates how data should be printed. Inmost cases, this is the same character that you would use in a call to printf() . One exception is the format i, which prints an instruction rather than a decimal integer.\u003Cbr>● unit_size indicates the size of the data to examine. It can be [b]ytes, [h]alfwords (2 bytes) , [w ]ords, or [g]iant words. By default, this is bytes, which is perfect for examining instructions. |","cbCaiqTrdkAPNSjt","https://ap.wps.com/l/cbCaiqTrdkAPNSjt","pdf",84207,"English","# 1 Introduction\n## How to run gdb\n# 2 GDB Commands","[{\"question\":\"How do you start GDB for a program?\",\"answer\":\"Run gdb with the executable path and optional arguments: gdb ./executable [arguments].\"},{\"question\":\"What GDB commands are used for breakpoints and conditional breakpoints?\",\"answer\":\"Use break \\u003clocation\\u003e to set a breakpoint, delete \\u003cbreakpoint #\\u003e to remove it, and condition \\u003cbreakpoint #\\u003e\\u003ccondition\\u003e to make a breakpoint hit only when the condition is true.\"},{\"question\":\"How can you inspect memory and view a stack trace in GDB?\",\"answer\":\"Use x/\\u003cnumber\\u003e\\u003cformat\\u003e\\u003cunit_size\\u003e \\u003caddress\\u003e to examine memory at an address with specified formatting and data size. Use backtrace (or the listed back[t]race command) to print a stack trace of functions and arguments.\"}]","gdb Cheatsheet - Fall 2019 | PDF",1791923534]