Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

NodeBB

  1. Home
  2. uncategorized
  3. On Linux, if I want a library that can produce a nice stack trace on demand with function name + line number in my C code, which is your recommended choice?

On Linux, if I want a library that can produce a nice stack trace on demand with function name + line number in my C code, which is your recommended choice?

Scheduled Pinned Locked Moved uncategorized
7 Posts 2 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    Guest
    wrote last edited by
    #1

    On Linux, if I want a library that can produce a nice stack trace on demand with function name + line number in my C code, which is your recommended choice?

    a1ba@suya.placeA ? 2 Replies Last reply
    0
    • ? Guest

      On Linux, if I want a library that can produce a nice stack trace on demand with function name + line number in my C code, which is your recommended choice?

      a1ba@suya.placeA This user is from outside of this forum
      a1ba@suya.placeA This user is from outside of this forum
      a1ba@suya.place
      wrote last edited by
      #2
      @bagder libbacktrace by Ian Lance Taylor
      a1ba@suya.placeA 1 Reply Last reply
      0
      • a1ba@suya.placeA a1ba@suya.place
        @bagder libbacktrace by Ian Lance Taylor
        a1ba@suya.placeA This user is from outside of this forum
        a1ba@suya.placeA This user is from outside of this forum
        a1ba@suya.place
        wrote last edited by
        #3
        @bagder it directly parses DWARF and can (though, that relies on UB) work from the signal handler.

        Plus it's not really that platform specifics as uses unwinder from C++ (that _Unwind_Backtrace call)
        1 Reply Last reply
        0
        • ? Guest

          On Linux, if I want a library that can produce a nice stack trace on demand with function name + line number in my C code, which is your recommended choice?

          ? Offline
          ? Offline
          Guest
          wrote last edited by
          #4

          I'm proceeding with libbacktrace (https://github.com/ianlancetaylor/libbacktrace) - there is also a package already in Debian. Seems do to the job for me just fine.

          Thanks everyone!

          a1ba@suya.placeA 1 Reply Last reply
          0
          • ? Guest

            I'm proceeding with libbacktrace (https://github.com/ianlancetaylor/libbacktrace) - there is also a package already in Debian. Seems do to the job for me just fine.

            Thanks everyone!

            a1ba@suya.placeA This user is from outside of this forum
            a1ba@suya.placeA This user is from outside of this forum
            a1ba@suya.place
            wrote last edited by
            #5
            @bagder forgot to tell you, keep in mind it might not be built the way you want. Plus GCC includes the static build of it and it's possible to accidentally link with what it includes.
            ? 1 Reply Last reply
            0
            • a1ba@suya.placeA a1ba@suya.place
              @bagder forgot to tell you, keep in mind it might not be built the way you want. Plus GCC includes the static build of it and it's possible to accidentally link with what it includes.
              ? Offline
              ? Offline
              Guest
              wrote last edited by
              #6

              @a1ba it works fine in my tests so I'm happy!

              a1ba@suya.placeA 1 Reply Last reply
              0
              • ? Guest

                @a1ba it works fine in my tests so I'm happy!

                a1ba@suya.placeA This user is from outside of this forum
                a1ba@suya.placeA This user is from outside of this forum
                a1ba@suya.place
                wrote last edited by
                #7
                @bagder ok then, good 🙂
                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Login or register to search.
                Powered by NodeBB Contributors
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups