[PATCH] D87233: [POC][DebugInfo] Use entry values within IR

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 7 06:59:41 PDT 2020


djtodoro added a comment.

(test.c was listed within llvm/test/DebugInfo/X86/entry-values-for-isel-invalidated-nodes.ll)
Looks like LLDB has a problem with parsing "complex" expression with DW_OP_entry_value:

  $ cat main.c
  #include <stdio.h>
  
  void f1(int x) {
    printf("%d\n", x);
  }
  
  int main()
  {
    f2(4);
    return 0;
  }

GCC generated debug_loc (gcc-test.o):

      00000000 0000000000000000 0000000000000009 (DW_OP_reg5 (rdi))
      00000013 0000000000000009 000000000000000e (DW_OP_GNU_entry_value: (DW_OP_reg5 (rdi)); DW_OP_stack_value)
      00000029 000000000000000e 000000000000001c (DW_OP_GNU_entry_value: (DW_OP_reg5 (rdi)); DW_OP_plus_uconst: 5; DW_OP_stack_value)
  $ gcc --version
  gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
  Copyright (C) 2015 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  $ lldb ./main-gcc
  (lldb) target create "./main-gcc"
  Current executable set to 'main-gcc' (x86_64).
  (lldb) b test.c:5
  Breakpoint 1: where = main-gcc`f2 + 14 at test.c:5, address = 0x000000000040119e
  (lldb) r
  Process 16815 launched: 'main-gcc' (x86_64)
  1
  Process 16815 stopped
  * thread #1, name = 'main-gcc', stop reason = breakpoint 1.1
      frame #0: 0x000000000040119e main-gcc`f2(i=5) at test.c:5
     2    void f2(int i) {
     3      f1(1);
     4      i = i + 5;
  -> 5      f1(3);
     6    }
     7
  (lldb) p i
  (int) $0 = 5

The same situation is with the test case compiled with clang (patched by using this change).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87233/new/

https://reviews.llvm.org/D87233



More information about the llvm-commits mailing list