C/C++ Stack Frames and gdb

Sdílet
Vložit
  • čas přidán 2. 09. 2020
  • A discussion of what a #stackframe is and how to look at them using #gdb.
    Course website with handouts: faculty.cs.niu.edu/~winans/CS...
    Music used in this video (Vibe Tracks, Alternate) was downloaded from the CZcams Audio Library: czcams.com/users/audiolibrary_...
  • Věda a technologie

Komentáře • 11

  • @MrAlFuture
    @MrAlFuture Před 3 lety +3

    Thanks, John! This series is awesome. You'd struck a really good balance between theory and practice I reckon.

  • @niceguyniceguy4450
    @niceguyniceguy4450 Před 2 lety +1

    666k subscribers at the moment, and the content is 👿 devilishly amazing.

  • @niceguyniceguy4450
    @niceguyniceguy4450 Před 2 lety

    Just amazing videos maaan, thank you, very much.👍👏

  • @user-tm7ek8qt3h
    @user-tm7ek8qt3h Před rokem +1

    Best explanation

  • @lehieu2335
    @lehieu2335 Před 2 lety

    Thanks John. I learn a lot from your series.

    • @JohnsBasement
      @JohnsBasement  Před 2 lety

      I'm glad to hear. Thank you for letting me know.

  • @Neo-kx3fe
    @Neo-kx3fe Před 3 lety +1

    Thank you for your video and it's very helpful. However, when you disassem a function in gdb, why the addr on the left side is ascending when the code is executing? I saw you place main() under foo() in the memory layout and thought the instructions should also be place reversely.

    • @JohnsBasement
      @JohnsBasement  Před 3 lety

      I'm not sure I understand this question. What time index in the video are you referring to when you talk about ascending addresses? --- ALL code execution other than branches will be comprised of instructions at ascending addresses.

    • @Neo-kx3fe
      @Neo-kx3fe Před 3 lety

      @@JohnsBasement First of all, thank you for your reply. Take @21:46 for an example, the addr of the instructions in main() are listed as 0x--52d9, 0x--52dd..., which are in the increasing order. Given the virtual memory layout you draw @8:41, can I say that the functions, as well as the corresponding instructions, are all reversely placed in the text segment? (Well, i just realize that 'reverse' is relative since the layout itself is visualized from high addr to low addr. Just a little bit confused here haha)

    • @JohnsBasement
      @JohnsBasement  Před 3 lety +1

      @@Neo-kx3fe OH... ugh... I drew foo() and main() in the wrong order when I drew the virtual memory map @8:41. I was going for 'these things go here' at that point. I should have shown foo() physically below main() in that drawing in order to match the order that they are placed in the load module... as the drawing I made of virtual memory has address zero at the bottom.
      I'm for the confusion there.
      HOWEVER, I would never count on the order of functions in my source code matching that in the compiled object/load module. Your compiler might surprise you!