Some resources that will help with next steps:
-
Look at the SwatDB Exceptions documentation off the SwatDB info page. It has examples of throwing and catching SwatDB exceptions, and links to the exception class documentation.
-
Refer to the Lab assignment page often for information, tips, about implementing and testing your solution.
-
Refer to the Testing part of the assignment page for some testing tips. Look at the note about the print methods of the BufferManager class to print out information about its state. You can call these from any of the test programs, or from within gdb.
-
Refer to the Details part of the assignment page for more verbose information about the methods you need to implement.
-
Also, look at
bufmgr.h
and the other.h
files for types, parameters, return values, and the SwatDB section for links to documetnation on other parts of SwatDB that is particularly useful for this lab (SwatDB types and the Disk Manager interface).
-
-
Use gdb to debug your code. If you don’t know what a method you wrote is doing, run the test program (
sandbox
,unittest
,checkpt
, etc.) in gdb, set break points in BufferManager methods and examine runtime state. -
Use valgrind to make sure any bugs you have are not due to memory access errors.
C++ Reminders
Look at the Wed Lab from Week 1 and Wed Lab from Week 2 pages for reminders about specify C++ programming and debugging tools and example programs we tried out for practice.
Let’s look at how to set a breakpoint in a method function from last week’s Wed Lab from Week 2 page.
In particular, if you are still a bit rusty using gdb
and valgrind
,
take some time to review them again so you are comfortable using
them to debug this lab. It will save you hours and hours of debugging
time to uses these tools, and we will ask you what you discovered
from gdb
and valgrind
about bugs you have in your program that you
want us to help you with--we expect that you are using
gdb
and valgrind
to debug.
The Lab 2: SwatDB Buffer Manager assignment page Resources Section for links to C++ programming resources.
Today
Most of today wil be time to work on your lab. We will come around and ask you to run your checkpoint for us and answer other questions about the lab.
./checkpt # or to run individual tests ./checkpt -s BufMapTest # list them ./checkpt -h