Giter VIP home page Giter VIP logo

Comments (3)

osandov avatar osandov commented on June 14, 2024 1

Actually I don't think it'll take much refactoring. Let's just make drgn_get_initial_registers() (via all of the arch-specific callbacks that implement it) return a NULL struct drgn_register_state * if there are no initial registers. Then each callback can decide what constitutes a hard error vs. a lack of a stack. I.e.,

struct drgn_register_state *regs;
err = drgn_get_initial_registers(..., &regs);
if (err)
    // handle hard error.
if (!regs)
    // return empty stack trace
// Handle common case

from drgn.

osandov avatar osandov commented on June 14, 2024

I like your option (a) because in general, when stack unwinding hits a FaultError, it stops and returns what it got so far; this would be an extension of that to the first frame. I don't love the idea of checking task.stack directly though, since I'm also not confident about task lifetimes (and it could be racy). I think it'd be better to catch the FaultError/DRGN_ERROR_FAULT at the source (in this case probably linux_kernel_get_initial_registers_x86_64), although that might require some refactoring.

from drgn.

brenns10 avatar brenns10 commented on June 14, 2024

Sounds good to me, I'll take a look at what sort of refactor it would be.

from drgn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.