* RE: amd64 executable debugging [not found] ` <CAKhyrx9t6VGEe5Zc-KwO3Cp-KLV+JUqtCnbQaUK7qcQqToz2aA@mail.gmail.com> @ 2018-03-24 13:14 ` vijay nag 2018-03-24 17:03 ` Simon Marchi 0 siblings, 1 reply; 5+ messages in thread From: vijay nag @ 2018-03-24 13:14 UTC (permalink / raw) To: gdb Hello GDB, Most often while debugging amd64 executable, GDB throws '<variable optimized out>' error and also sometimes when function parameters are passed on register GDB reports incorrect information in few frames. I'm sure in 64 bit with more registers available, there is more revenue for optimization, it is entirely possible that GDB gets confused due to that and information provided by GDB isn't reliable sometimes. I'm wondering if the latest GDB has somehow solved this problem Or disassembling and studying instructions is the only way to go about it ? Also, is there a way to increase this debug-ability by adding any additional compiler flags ? --Vijay-- ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: amd64 executable debugging 2018-03-24 13:14 ` amd64 executable debugging vijay nag @ 2018-03-24 17:03 ` Simon Marchi 2018-03-25 6:02 ` vijay nag 0 siblings, 1 reply; 5+ messages in thread From: Simon Marchi @ 2018-03-24 17:03 UTC (permalink / raw) To: vijay nag; +Cc: gdb On 2018-03-24 09:14, vijay nag wrote: > Hello GDB, > > Most often while debugging amd64 executable, GDB throws '<variable > optimized out>' error and also sometimes when function parameters are > passed on register GDB reports incorrect information in few frames. I'm > sure in 64 bit with more registers available, there is more revenue for > optimization, it is entirely possible that GDB gets confused due to > that > and information provided by GDB isn't reliable sometimes. I'm > wondering if > the latest GDB has somehow solved this problem Or disassembling and > studying instructions is the only way to go about it ? Also, is there a > way > to increase this debug-ability by adding any additional compiler flags > ? > > --Vijay-- Hi Vijay, You didn't mention it so I'll state the obvious, do you build without optimizations (-O0)? Otherwise, it's expected to have some optimized out values. Simon ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: amd64 executable debugging 2018-03-24 17:03 ` Simon Marchi @ 2018-03-25 6:02 ` vijay nag 2018-03-25 6:04 ` vijay nag 0 siblings, 1 reply; 5+ messages in thread From: vijay nag @ 2018-03-25 6:02 UTC (permalink / raw) To: Simon Marchi; +Cc: gdb Yes, I did. I was trying to postmortem a field crash on an optimized binary. [Kindly excuse my typos in my previous and read revenue as avenue. ] On Mar 24, 2018 10:33 PM, "Simon Marchi" <simon.marchi@polymtl.ca> wrote: > On 2018-03-24 09:14, vijay nag wrote: > >> Hello GDB, >> >> Most often while debugging amd64 executable, GDB throws '<variable >> optimized out>' error and also sometimes when function parameters are >> passed on register GDB reports incorrect information in few frames. I'm >> sure in 64 bit with more registers available, there is more revenue for >> optimization, it is entirely possible that GDB gets confused due to that >> and information provided by GDB isn't reliable sometimes. I'm wondering >> if >> the latest GDB has somehow solved this problem Or disassembling and >> studying instructions is the only way to go about it ? Also, is there a >> way >> to increase this debug-ability by adding any additional compiler flags ? >> >> --Vijay-- >> > > Hi Vijay, > > You didn't mention it so I'll state the obvious, do you build without > optimizations (-O0)? Otherwise, it's expected to have some optimized out > values. > > Simon > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: amd64 executable debugging 2018-03-25 6:02 ` vijay nag @ 2018-03-25 6:04 ` vijay nag 2018-03-25 11:35 ` Simon Marchi 0 siblings, 1 reply; 5+ messages in thread From: vijay nag @ 2018-03-25 6:04 UTC (permalink / raw) To: Simon Marchi; +Cc: gdb I mean the executable was built with -O2. The question is has GDB somehow managed to fix this problem on optimized binaries ? --Vijay-- On Mar 25, 2018 11:32 AM, "vijay nag" <vijunag@gmail.com> wrote: > Yes, I did. I was trying to postmortem a field crash on an optimized > binary. > > [Kindly excuse my typos in my previous and read revenue as avenue. ] > > On Mar 24, 2018 10:33 PM, "Simon Marchi" <simon.marchi@polymtl.ca> wrote: > >> On 2018-03-24 09:14, vijay nag wrote: >> >>> Hello GDB, >>> >>> Most often while debugging amd64 executable, GDB throws '<variable >>> optimized out>' error and also sometimes when function parameters are >>> passed on register GDB reports incorrect information in few frames. I'm >>> sure in 64 bit with more registers available, there is more revenue for >>> optimization, it is entirely possible that GDB gets confused due to that >>> and information provided by GDB isn't reliable sometimes. I'm wondering >>> if >>> the latest GDB has somehow solved this problem Or disassembling and >>> studying instructions is the only way to go about it ? Also, is there a >>> way >>> to increase this debug-ability by adding any additional compiler flags ? >>> >>> --Vijay-- >>> >> >> Hi Vijay, >> >> You didn't mention it so I'll state the obvious, do you build without >> optimizations (-O0)? Otherwise, it's expected to have some optimized out >> values. >> >> Simon >> > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: amd64 executable debugging 2018-03-25 6:04 ` vijay nag @ 2018-03-25 11:35 ` Simon Marchi 0 siblings, 0 replies; 5+ messages in thread From: Simon Marchi @ 2018-03-25 11:35 UTC (permalink / raw) To: vijay nag; +Cc: gdb On 2018-03-25 02:04, vijay nag wrote: > I mean the executable was built with -O2. The question is has GDB > somehow > managed to fix this problem on optimized binaries ? If GDB says the value is optimized out, it's probably because it's really not available. However, if you are able to find the value by unwinding by hand, it could mean that the DWARF information output by the compiler could be enhanced so that debuggers are able to find it as well. Simon ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-03-25 11:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CAKhyrx-QBqN85fXQnoE+4c9B84xsUZ+DroFfjHQPcXxX5d9kjg@mail.gmail.com>
[not found] ` <CAKhyrx-DKjK0rBxnZF8AfmxyX92esSqhkV5g8xL6TDOXMn4qcQ@mail.gmail.com>
[not found] ` <CAKhyrx9tfUc5qkWfeTAURJovHvjQN0g2zER-iKiuP+gyvx9Z+g@mail.gmail.com>
[not found] ` <CAKhyrx-pEi+jJD9zAvUpcuMeY3nocB1VVKv6ro8DE6m-8NYGuA@mail.gmail.com>
[not found] ` <CAKhyrx9C9R7_AJaL8YC2Wz74Hk+-FtxMcOoZQPPztmDnSOyVGw@mail.gmail.com>
[not found] ` <CAKhyrx-7=dJOB9Mz=JdauejT7QLyJA4iAjNiH+fejsX397=bHA@mail.gmail.com>
[not found] ` <CAKhyrx8XLzP1MKp_YZFE0nmk1Q51WRXNMEzO5kHNjjB5ypWk5g@mail.gmail.com>
[not found] ` <CAKhyrx-Pc5KZbtyPSOAc+XLJNDXYsJG9umZCFShLrJ54ELMtiA@mail.gmail.com>
[not found] ` <CAKhyrx84JMZ2tBB2FE0gux8aF2Jd9k8571ni6-u4w3G5Chy8Dw@mail.gmail.com>
[not found] ` <CAKhyrx-3h2KAU4jy2t_fbYZa32ZwZRYdZuB==oBvKtQQzq1v3w@mail.gmail.com>
[not found] ` <CAKhyrx_cATMnN_R6BL+X0mynNw7rLh2b7ekmbrEZsG3AV8wP_A@mail.gmail.com>
[not found] ` <CAKhyrx8B3AD6BR8Obi-2mALfrbk20bE3J6EJa=87-Qr4XBwwMQ@mail.gmail.com>
[not found] ` <CAKhyrx-q-+LBActXatdDqFZCUCTdMFxqEYvz9pMTRBK4ahX8uQ@mail.gmail.com>
[not found] ` <CAKhyrx9LHywr=zK7w5k+VL=WQF+xuMK+=Y4sL+F_BOAq0rjKMQ@mail.gmail.com>
[not found] ` <CAKhyrx88oQECMaR8jYtgSgr4V4HQ_7vdiSYmg-OD3m8+RhvtQQ@mail.gmail.com>
[not found] ` <CAKhyrx9Y7GSN0PrUBYsPi63ngQKkpsyNbMf5+x6TBpinqF=D2Q@mail.gmail.com>
[not found] ` <CAKhyrx8tH6bCziypL_aDiyF_x0HZt6TQQa1gSSdW-eYEB1AEEA@mail.gmail.com>
[not found] ` <CAKhyrx9jKJShS2rgL9S=h3rpqq++mB6j=8Y88UXJ9dn7DbwB+g@mail.gmail.com>
[not found] ` <CAKhyrx9t6VGEe5Zc-KwO3Cp-KLV+JUqtCnbQaUK7qcQqToz2aA@mail.gmail.com>
2018-03-24 13:14 ` amd64 executable debugging vijay nag
2018-03-24 17:03 ` Simon Marchi
2018-03-25 6:02 ` vijay nag
2018-03-25 6:04 ` vijay nag
2018-03-25 11:35 ` Simon Marchi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox