![]() Waiting for gdb connection on localhost:1234 To debug this, I start pintos with the -gdb (~/pintos/pintos-solution2/src/threads/build) > pintos -v -gdb -q -mlfqs run mlfqs-load-1 Writing command line to /tmp/gDAlqTB5Uf.dsk.īuild from CVS snapshot on December 30, 2005Ġ0000000000i reading configuration from bochsrc.txtĠ0000000000i installing nogui module as the Bochs GUIĠ0000000000i using log file bochsout.txt Occasionally forget to wake up threads that called timer_sleep().Ĭonsequently, tests such as mlfqs_load_1 get stuck. In this example, I introduced a bug in my solution to Project 1 where I would Using btthreadlist to detect where Pintos is stuck Input you'd type into gdb is shown in brown. Which as a reminder we recommend only for the more daring among you. Strategy to verify user memory accesses as outlined in In Project 3, the same applies, unless you chose the get_user/put_user Kernel - because your kernel should never crash. In Project 2, page fault exceptions in kernel code are always bugs in your Pintos-debug: a page fault occurred in kernel modeįollowed by the output of the btpagefault command. In this case, the stop hook will print this message: It occurred in kernel mode while executing kernel code. If the page fault did not occur in user mode while executing user code, then Page_fault and need to program the appropriate action there. The process was trying to access, either because it was swapped out or because Of a process, rather you may have to page in the page containing the address In Project 3, such page faults no longer automatically lead to the termination Which you will need to modify accordingly. To debug those, set a break point in page_fault in exception.c, Kernel properly terminates processes that try to access invalid addresses. Page faults to occur in the robustness tests where we test that your They lead to the termination of the process. Page faults in user mode require the following actions: In Project 2, Pintos-debug: hit 'c' to continue, or 's' to step to intr_handler Pintos-debug: a page fault exception occurred in user mode The stop hook will show you which is the case. Process was executing user code when it accessed an invalid address, or There are multiple cases, but they break down into two groups: your Page fault exceptions occur whenever a process accesses memory to which itĭoes not have permissions according to the currently active page directory. Hook-stop is not a command you invoke, it is a command that gdb invokesĮvery time your kernel stops because a page fault exception occurred. Table using add-symbol-file, as outlined in Occurring in a user process, you may also wish to load its symbol Kernel code, but should you need to track down exceptions Usually, you will need to track down exceptions occurring in In that case, the "bt" command might not give a useful backtrace.įor page faults that occur in kernel code or in user code. Normally, when a page fault exception occurs, gdb will stop with a message that Print a backtrace of the current thread after a page fault exception. Threads are stuck when a deadlock occurs. This command is useful to determine where your Shows the backtraces of all threads contained in "struct list all_list", linked Struct thread to link the threads together. Struct list in which the threads are kept, and the list_elem field used inside ![]() Shows the backtraces of all threads in a list. ![]() You know where their kernel stack page is located. However, it also works for threads that are suspended in schedule(), provided The "struct thread" of the thread whose backtrace it should show.įor the current thread, this is identical to the "bt" or backtrace command. Takes one parameter, which is a pointer to Using the "struct list_elem all_elem" which is part of "struct thread". Prints all elements of type "struct thread" that are linked in "struct list all_list" Takes three parameters:Ī struct list, the declared type of the list elements (without the word "struct"!),Īnd the name of the list_elem field in that struct used to link the list elements.Įxample: dumplist all_list thread all_elem The following table gives an overview of the commands this file provides:Īttach debugger to a waiting pintos process on the same machine. Source /home/courses/cs3204/gb/pintos-gdb-macros First, you need to make those commands known to gdb with the You can type help user-defined to see help on theseĬommands. User-defined commands to gdb that can help you debug your Pintos kernel. This page contains examples of how to use the How to use the Pintos GDB macros How to use the Pintos GDB macros Written by Godmar Back, March 2006
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |