You can use file and objdump on Linux. In particular, you can look at whether file says "stripped" or "not stripped" (under my Ubuntu 20.04.1 LTS, whether an executable is compiled with -g or not shows not stripped with file command. But the one with -g, shows with debug_info, in addition to that), and whether objdump --syms outputs anything useful (for me, it says "no symbols" for a regular build).
Example of that same kernel module I've compiled with debug information:
geertvc@jimi:~/mystuff/kernels/linux-3.12.6$ objdump --syms ./modules/lib/modules/3.12.6/kernel/drivers/i2c/busses/i2c-at91.ko | grep debug
00000000 l d .debug_frame 00000000 .debug_frame
00000000 l d .debug_info 00000000 .debug_info
00000000 l d .debug_abbrev 00000000 .debug_abbrev
00000000 l d .debug_loc 00000000 .debug_loc
00000000 l d .debug_aranges 00000000 .debug_aranges
00000000 l d .debug_ranges 00000000 .debug_ranges
00000000 l d .debug_line 00000000 .debug_line
00000000 l d .debug_str 00000000 .debug_str
00000010 l .debug_frame 00000000 $d
As you can see, the first output returns nothing, while the second output returns lines with debug in it.
Note: in my case, the file command returned me "not stripped" in both debug and non-debug case. However, the difference in size of the kernel object was remarkable:
approx. 16k without debug information
approx. 137k with debug information
Clearly, the latter version had debug information inside.
My question: is the file command reliable in such cases?
From what I've experienced, I rely on the objdump --syms ... | grep debug command.