-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"frame variable config" of lldb can't display any thing after build with "./ci/do_ci.sh debug.server_only" #35153
Comments
past build command |
When changing code error in purpose, got below output, it can see related debug flag is correct. |
After changing file /source/bazel/envoy_internal.bzl and add "-O0"
From below address lookup, it still miss the variable information, don't know how it missed by clang++ as you can see below in my test private build case, it has everything
thanks |
hi @htuch |
@coolg92003 please use markdown code fencing (with it would make it much easier to read your issue and more likely anyone can help |
Hi @phlax
Which Option create difference? cat cfx.cc
#include <iostream>
#include <string>
std::string str_g = "global string";
namespace Envoy {
namespace Extensions {
namespace HttpFilters {
namespace TapFilter {
void testv(int i)
{
// cfx
std::cout << "\ntestv: i:" << i << std::endl;
int j=9;
std::cout << "\ntestv: j+i:" << j+9 << std::endl;
return;
}
int i_g = 64;
class An {
public:
void displayValue(int j) {
std::cout << "\n\tdisplay: i=" << i << std::endl;
std::cout << "\n\tdisplay: end, this=" << this << std::endl;
int i=3;
std::cout << "\n\tdisplay: end, i+j=" << i+j << std::endl;
std::cout << "\n\tdisplay: end\n";
}
private:
int i =9;
};
}
}
}
}
int main()
{
int j=2;
std::cout << "main: enter\n";
Envoy::Extensions::HttpFilters::TapFilter::testv(j);
Envoy::Extensions::HttpFilters::TapFilter::An l_an;
l_an.displayValue(j);
std::cout << "main: exit\n";
return 0;
} I had changed below part
but it still have no effect. thanks |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions. |
Title: frame variable config" of lldb can't display any thing
Description:
Recent, there are something confusion in envoy code. therefore, try to build a debug version of envoy to check stepbystep. however,
It can't display anything when doing test, no matter on trying "p config" or "var config" or "frame variable config", see below
lldb --version
lldb version 14.0.0
lldb /build/envoy/x64/source/exe/envoy/envoy
(lldb) target create "/build/envoy/x64/source/exe/envoy/envoy"
Current executable set to '/build/envoy/x64/source/exe/envoy/envoy' (x86_64).
(lldb) settings set target.source-map /proc/self/cwd /source
(lldb) b setDecoderFilterCallbacks
Breakpoint 1: 40 locations.
(lldb) settings set target.debug-file-search-paths /build/bazel_root/base/execroot/envoy
(lldb) r -l debug -c /tmp/test/fFtapenvoy.yaml --concurrency 1 --log-path /tmp/test/envoy.log
Process 881306 launched: '/build/envoy/x64/source/exe/envoy/envoy' (x86_64)
Process 881306 stopped
Process 881306 stopped
thread #9, name = 'wrk:worker_0', stop reason = step over
frame #0: 0x000055555bb2bab1 envoy`Envoy::Extensions::HttpFilters::TapFilter::Filter::setDecoderFilterCallbacks(Envoy::Http::StreamDecoderFilterCallbacks&) at tap_filter.h:102:16
99 Http::FilterTrailersStatus decodeTrailers(Http::RequestTrailerMap& trailers) override;
100 void setDecoderFilterCallbacks(Http::StreamDecoderFilterCallbacks& callbacks) override {
101 HttpTapConfigSharedPtr config = config_->currentConfig();
-> 102 if (config != nullptr) {
103 auto streamId = callbacks.streamId();
104 auto connection = callbacks.connection();
105 tapper_ = config->createPerRequestTapper(config_->getTapConfig(), streamId, connection);
(lldb) p config
error: expression failed to parse:
error: <user expression 0>:1:1: reference to 'config' is ambiguous
config
^
note: candidate found by name lookup is 'config'
note: candidate found by name lookup is 'config'
(lldb) var config
(lldb) frame variable config
(lldb)
In fact,
I have read doc of below
https://github.com/envoyproxy/envoy/blob/main/bazel/README.md#supported-compiler-versions
add below
--copt=-fno-limit-debug-info
in my source code /source/.bazelrc as below
build:clang-cl --copt="-fno-limit-debug-info"
it also doesn't work,
then we try to add debug path as below:
settings set target.debug-file-search-paths /build/bazel_root/base/execroot/envoy
because of *.dwo of debugged function as below:
/build/bazel_root/base/execroot/envoy/bazel-out/k8-dbg/bin/source/extensions/filters/http/tap/_objs/tap_config_impl/tap_config_impl.pic.dwo
then I try a test private code as below and all works fine
envoybuild@cfx-build:/tmp/test$ ls cfx*
cfx.cc
envoybuild@cfx-build:/tmp/test$ clang++ -o a -gsplit-dwarf -ggdb3 cfx.cc
envoybuild@cfx-build:/tmp/test$ ls cfx*
cfx.cc cfx.dwo
envoybuild@cfx-build:/tmp/test$ lldb ./a
(lldb) target create "./a"
Current executable set to '/tmp/test/a' (x86_64).
(lldb) b testv
Breakpoint 1: where = a`testv(int) + 11 at cfx.cc:6:12, address = 0x00000000004012cb
(lldb) r
Process 881362 launched: '/tmp/test/a' (x86_64)
main: enter
Process 881362 stopped
frame #0: 0x00000000004012cb a`testv(i=2) at cfx.cc:6:12
3 std::string str_g = "global string";
4 void testv(int i)
5 {
-> 6 std::cout << "\ntestv: i:" << i << std::endl;
7 return;
8 }
9 int main()
(lldb) p i
(int) $0 = 2
(lldb) frame variable i
(int) i = 2
(lldb) var i
(int) i = 2
4) from current see, the only difference, in envoy, the building output is(no dwo file, only one dwp file)
envoybuild@cfx-build:~/envoy/x64/source/exe/envoy$ ls -alt /build/envoy/x64/source/exe/envoy
total 2182184
-r-xr-xr-x. 1 envoybuild envoygroup 597614616 Jul 11 11:32 envoy.dwp
drwxr-xr-x. 2 envoybuild envoygroup 52 Jul 11 11:32 .
-r-xr-xr-x. 1 envoybuild envoygroup 1634070736 Jul 11 11:31 envoy
There is a dwp file there, there is no dwo. however, I have give the dwo file path as target.debug-file-search-paths
why still not work?
anything missed?
Also, I try gdb, it doesn't work because I can't set break-point as below:
gdb ./envoy
GNU gdb (Ubuntu 10.2-0ubuntu1
20.041) 10.2Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
https://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./envoy...
Dwarf Error: bad DWP hash table, lookup didn't terminate [in module /build/envoy/x64/source/exe/envoy/envoy.dwp]
(gdb)
Thanks
CLiff
The text was updated successfully, but these errors were encountered: