GDB displays the incorrect result with the built-in l or p command on aarch64

Solution In Progress - Updated -

Issue

  • GDB displays the incorrect result with the built-in l or p command on aarch64.
# gdb -q /usr/lib/debug/lib/modules/5.14.0-39.el9.aarch64/vmlinux
Reading symbols from /usr/lib/debug/lib/modules/5.14.0-39.el9.aarch64/vmlinux...

(gdb) l freezer_write
73
74      extern char *strim(char *);
75
76      static inline __must_check char *strstrip(char *str)
77      {
78              return strim(str);
79      }
80
81      #ifndef __HAVE_ARCH_STRSTR
82      extern char * strstr(const char *, const char *);

(gdb) p freezer_write
$1 = {ssize_t (struct kernfs_open_file *, char *, size_t, loff_t)} 0xffff80001019a5bc <freezer_write>

(gdb) l *0xffff80001019a5bc
0xffff80001019a5bc is in freezer_write (./include/linux/string.h:78).
73
74      extern char *strim(char *);
75
76      static inline __must_check char *strstrip(char *str)
77      {
78              return strim(str);
79      }
80
81      #ifndef __HAVE_ARCH_STRSTR
82      extern char * strstr(const char *, const char *);
  • GDB displays the correct result with the built-in l or p command on x86-64.
# gdb -q /usr/lib/debug/lib/modules/5.14.0-70.el9.x86_64/vmlinux 
Reading symbols from /usr/lib/debug/lib/modules/5.14.0-39.el9.x86_64/vmlinux...

(gdb) l freezer_write
416             mutex_unlock(&freezer_mutex);
417     }
418
419     static ssize_t freezer_write(struct kernfs_open_file *of,
420                                  char *buf, size_t nbytes, loff_t off)
421     {
422             bool freeze;
423
424             buf = strstrip(buf);
425

(gdb) p freezer_write
$1 = {ssize_t (struct kernfs_open_file *, char *, size_t, loff_t)} 0xffffffff811b9720 <freezer_write>

(gdb) l *0xffffffff811b9720
0xffffffff811b9720 is in freezer_write (kernel/cgroup/legacy_freezer.c:421).
416             mutex_unlock(&freezer_mutex);
417     }
418
419     static ssize_t freezer_write(struct kernfs_open_file *of,
420                                  char *buf, size_t nbytes, loff_t off)
421     {
422             bool freeze;
423
424             buf = strstrip(buf);
425

Environment

  • Red Hat Enterprise Linux release 9.0
  • gdb
  • aarch64

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content