Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4081708
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:05:44+00:00 2026-05-20T18:05:44+00:00

In DWARF2 debugging format, stack unwinding is supported with the help of CFI(Call Frame

  • 0

In DWARF2 debugging format, stack unwinding is supported with the help of CFI(Call Frame Information) present in .debug_frame section. This is precisely a table that keeps a rule for every register to get its value in previous frame. However, all of these rules relies on the fact that the registers are saved on stack at some location.
This is not true for getting value of stack pointer in previous frame register when there is no frame-pointer. In such cases, stack pointer may not be saved on stack but just managed by incrementing and decrementing its value. However, there is no way in dwarf2 (or dwarf format in general) to indicate that the register value is an expression over its current value.
So, my question is, how can one get the value of stack pointer during stack unwinding with dwarf2 debugging format (when no frame-pointer is there).

-BV

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T18:05:45+00:00Added an answer on May 20, 2026 at 6:05 pm

    It seems that dwarf3 supports DW_CFA_val_offset for such a case. So, this can be used to record value of SP in previous frame based on a arithmetic expression over current value.
    Another possible solution could be to save stack pointer on stack itself (will work with dwarf2). This can be done at -O0 optimization level where the code efficiency is not that important.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

GCC supports Setjump-longjump (sjlj) and Dwarf2 table-based unwinding (dw2) exception handling models. What is
I'm using gdb and libbfd to retrieve global variables information from an elf file
I'm looking to write a tool that aims to convert debug symbols of one
I'm writing a game for iOS. It has a game map, and I'm using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.