Live data from Hacker News

Automatically download symbols and sources in GDB

sourceware.org

11–20 of 21 posts

Re: Automatically download symbols and sources in GDB

#11
post #8

Earlier quoted context omitted.

"Good enough" solutions were already in place for many years, that's why a symbol server was not a matter of urgency. Did you know about the following? • A package manager can be configured to install the corresponding debuginfo/debugsource packages, this is literally one menu toggle. It's off by default to save disk space, as most users don't need them. • A desktop environment crash handler (e.g. drkonqi) offers to…

I'm not aware of those solutions. Very cool! Are they specific to one distro (for example, Fedora)? How do I get gdb to show me the command to installing missing packages? One downside to those solutions, they only support debugging on the same machine running the executable. If I want to debug a crash dump from a machine different from my own I might not be able to install the packages.

> Are they specific to one distro

no

> How do I get gdb to show me the command

With the "run" command. You get a message "Missing separate debuginfos, use:" and then debuginfo-install, zypper etc. depending on the distro.

Re: Automatically download symbols and sources in GDB

#12

I strongly encourage developments like that. It’s a shame that Linux and macOS didn’t adopt something like Microsoft’s symbol server. This project could become something like this. If you have an installation like this you can also plug it into Sentry as symbol server and it picks it up.

Apple runs something similar internally, as it can correlate debug symbols to binaries by checking the UUID the linker sticks in it. Unfortunately, it’s not generally available…

There used to be a hack where you could write your own UUID-to-dSYM script, name it "dsymForUUID", and then lldb would assume it was Apple's internal magic thing and use it. Fortunately lldb seems to have improved since those days, and has less magical options available:

http://lldb.llvm.org/use/symbols.html

Re: Automatically download symbols and sources in GDB

#13
post #8

I strongly encourage developments like that. It’s a shame that Linux and macOS didn’t adopt something like Microsoft’s symbol server. This project could become something like this. If you have an installation like this you can also plug it into Sentry as symbol server and it picks it up.

"Good enough" solutions were already in place for many years, that's why a symbol server was not a matter of urgency. Did you know about the following? • A package manager can be configured to install the corresponding debuginfo/debugsource packages, this is literally one menu toggle. It's off by default to save disk space, as most users don't need them. • A desktop environment crash handler (e.g. drkonqi) offers to…

In Opensuse (release, haven't used Tumbleweed) I found it easy to install debuginfo and debugsource packages.

In Ubuntu I found it slightly confusing to locate debug symbol packages. I understood (or misunderstood) that there are 2 options where to find debug symbols and it just depends on the package maintainer how it's done. I did not find how to install debugsource at all.

By doing debugsource I mean the source that has all the patches applied exactly as during the build and is in the same path as the symbols suggest.

Re: Automatically download symbols and sources in GDB

#14

Any chance that Linux package managers will integrate this for their -dbg packages? I’d rather not fiddle with downloading those along with -src, untarring it, telling GDB where to find the code…

Arch may do this as they still haved figured out how distribute debug packages.

Re: Automatically download symbols and sources in GDB

#15
post #8

I strongly encourage developments like that. It’s a shame that Linux and macOS didn’t adopt something like Microsoft’s symbol server. This project could become something like this. If you have an installation like this you can also plug it into Sentry as symbol server and it picks it up.

"Good enough" solutions were already in place for many years, that's why a symbol server was not a matter of urgency. Did you know about the following? • A package manager can be configured to install the corresponding debuginfo/debugsource packages, this is literally one menu toggle. It's off by default to save disk space, as most users don't need them. • A desktop environment crash handler (e.g. drkonqi) offers to…

None of what we have is good enough unfortunately. If you have a random crash from a customer you’re out of luck.

Re: Automatically download symbols and sources in GDB

#16
post #8

Earlier quoted context omitted.

"Good enough" solutions were already in place for many years, that's why a symbol server was not a matter of urgency. Did you know about the following? • A package manager can be configured to install the corresponding debuginfo/debugsource packages, this is literally one menu toggle. It's off by default to save disk space, as most users don't need them. • A desktop environment crash handler (e.g. drkonqi) offers to…

None of what we have is good enough unfortunately. If you have a random crash from a customer you’re out of luck.

You load up the debug info and get all file/line info you need, or you debug the core file.

Re: Automatically download symbols and sources in GDB

#17

I strongly encourage developments like that. It’s a shame that Linux and macOS didn’t adopt something like Microsoft’s symbol server. This project could become something like this. If you have an installation like this you can also plug it into Sentry as symbol server and it picks it up.

Yep, in case of Linux the 'it's OSS. Download the tar.gz configure --enable-debug and deal with it' attitude hampered the development and use of something like a Symbol Server. Microsoft has had it since at least 2005 - that's the first Visual Studio release I remember using it with - so it might have exited before that. It's things like these that separate MS from all others - Engineering culture of having to give 2…

What are you talking about? Linux distros come with debug info packages.

Re: Automatically download symbols and sources in GDB

#18

Earlier quoted context omitted.

Yep, in case of Linux the 'it's OSS. Download the tar.gz configure --enable-debug and deal with it' attitude hampered the development and use of something like a Symbol Server. Microsoft has had it since at least 2005 - that's the first Visual Studio release I remember using it with - so it might have exited before that. It's things like these that separate MS from all others - Engineering culture of having to give 2…

What are you talking about? Linux distros come with debug info packages.

Yeah I know - that's a more recent thing however and the attitude in the early days was what I was referring to.

Oh and the debuginfo packages used to be and still are huge in size. Not sure if anything has changed most recently but the concept of lazy loading symbols from remote and storing only what you need locally is not something you can do with debuginfo packages.

Re: Automatically download symbols and sources in GDB

#19

Earlier quoted context omitted.

What are you talking about? Linux distros come with debug info packages.

Yeah I know - that's a more recent thing however and the attitude in the early days was what I was referring to. Oh and the debuginfo packages used to be and still are huge in size. Not sure if anything has changed most recently but the concept of lazy loading symbols from remote and storing only what you need locally is not something you can do with debuginfo packages.

Oh yes, the size is killing it. Our applications are not that big so the bandwidth use isn't completely insane, but I see the problem.

Re: Automatically download symbols and sources in GDB

#20

Earlier quoted context omitted.

None of what we have is good enough unfortunately. If you have a random crash from a customer you’re out of luck.

You load up the debug info and get all file/line info you need, or you debug the core file.

With the Microsoft tooling, you debug a crash dump and your IDE automatically pulls in the symbol data from your symbol server and then automatically checks out the appropriate revisions from your config management system, because the references are embedded into the symbol files at build time.

It’s a much better mechanism than anything I’ve looked at in the Linux space (caveat: I have not been developing C++ for a while).

I was so impressed I started looking at what it would take to implement for the gcc/gdb toolchain but discovered Microsoft held a patent and gave up.

Post reply on HN