================ @@ -3,17 +3,30 @@ # int baz(); # int bar() { return 47; } # int foo(int flag) { return flag ? bar() : baz(); } -# The function bar has been placed "in the middle" of foo. +# The function bar has been placed "in the middle" of foo, and the function +# entry point is deliberately not its lowest address. # RUN: llvm-mc -triple x86_64-pc-linux -filetype=obj %s -o %t -# RUN: %lldb %t -o "image lookup -v -n foo" -o exit | FileCheck %s +# RUN: %lldb %t -o "image lookup -v -n foo" -o "expr -- &foo" -o exit | FileCheck %s +# CHECK-LABEL: image lookup # CHECK: 1 match found in {{.*}} # CHECK: Summary: {{.*}}`foo # CHECK: Function: id = {{.*}}, name = "foo", ranges = [0x0000000000000000-0x000000000000000e)[0x0000000000000014-0x000000000000001c) +# CHECK-LABEL: expr -- &foo +# CHECK: (void (*)()) $0 = 0x0000000000000007 + .text +foo.__part.1: + .cfi_startproc + callq bar + jmp foo.__part.3 +.Lfoo.__part.1_end: + .size foo.__part.1, .Lfoo.__part.1_end-foo.__part.1 + .cfi_endproc + .type foo,@function foo: ---------------- DavidSpickett wrote:
When you print `&foo`, you are expecting the value of it to point here, instead of to `foo.__part.1:`, which is earlier but not actually the entry point. Do I understand that correctly? https://github.com/llvm/llvm-project/pull/122440 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits