CS341 - Intro. to Computer Architecture and Organization - Professor Ackley

Tuesday and Thursday: 9:30am - 10:45am (Centennial 1028) Lab: Friday 2:00pm - 2:50pm (Centennial B146)

Buf Intro

Goals

  • Stack Frame Overview
  • Level 0: Step-by-Step

Needs


Ask Some Questions!


GDB Stuff and Reminders

  • print /a ___ -> prints as a hex address. Can take direct math (i.e. $esp+4) or a dereferenced address if what the address points to is another pointer (i.e. print /a *0x085647fc will work if 0x085647fc, and the contents of 0x085647fc, are pointers.) NOTE: To get this to work with direct math on a register, we must cast the resulting address of the sum as a pointer to a pointer (i.e. print /a *(void**)($esp+4)). This was the solution to a problem we had earlier.
  • x/x 0x_____ -> is the equivalent of the above, but doesn't need the cast. This says, trust me, I know what this is, just examine this address as a hexadecimal address (i.e. x/x ($esp+4) is equivalent to print /a *(void**)($esp+4)).
  • :$ objdump -d disas.txt is extremely helpful in this lab.
  • Stack grows towards lower addresses.
  • A byte takes 2 hex numbers.