Compilation error when trying to compile kgdboe

Sysprogs forums Forums VisualKernel Compilation error when trying to compile kgdboe

This topic contains 1 reply, has 2 voices, and was last updated by  support 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #33020

    subvert
    Participant

    I tried to follow your guide:

    https://sysprogs.com/VisualKernel/kgdboe/tutorial/

    And compile the kgdboe manually, Tried these distrubutions:

    Fedora 36

    Ubuntu 22.04

    Ubuntu 18.04

    Ubuntu 14.04

    It either doesn’t compile, or even if it compiles, it gives the following error when i try to insmod: “Invalid Parameters”. Related issue:

    https://stackoverflow.com/questions/16360689/invalid-parameters-error-when-trying-to-insert-module-that-accesses-exported-s

    One example of compiling error:

     

    Cannot build kgdboe

    Run “make -C “/lib/modules/$(uname -r)/build” M=”/tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8″ modules” in directory “” on local computer
    ————————–
    make: Entering directory ‘/usr/src/linux-headers-5.15.0-46-generic’
    CC [M] /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/irqsync.o
    CC [M] /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/kgdboe_main.o
    CC [M] /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/kgdboe_io.o
    make: Leaving directory ‘/usr/src/linux-headers-5.15.0-46-generic’
    /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/kgdboe_main.c: In function ‘kgdboe_init’:
    /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/kgdboe_main.c:71:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    71 | int err = kgdboe_io_init(device_name, udp_port, local_ip, force_single_core != 0);
    | ^~~
    /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/kgdboe_io.c: In function ‘kgdboe_rx_handler’:
    /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/kgdboe_io.c:40:17: error: implicit declaration of function ‘kgdb_schedule_breakpoint’; did you mean ‘kgdb_arch_remove_breakpoint’? [-Werror=implicit-function-declaration]
    40 | kgdb_schedule_breakpoint();
    | ^~~~~~~~~~~~~~~~~~~~~~~~
    | kgdb_arch_remove_breakpoint
    /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/kgdboe_io.c: In function ‘kgdboe_read_char’:
    /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/kgdboe_io.c:76:5: warning: this ‘while’ clause does not guard… [-Wmisleading-indentation]
    76 | while (s_IncomingRingBufferReadPosition == s_IncomingRingBufferWritePosition)
    | ^~~~~
    /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/kgdboe_io.c:79:9: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’
    79 | result = s_IncomingRingBuffer[s_IncomingRingBufferReadPosition++];
    | ^~~~~~
    In file included from /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/kgdboe_io.c:8:
    /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/kgdboe_io.c: In function ‘kgdboe_io_init’:
    /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/tracewrapper.h:8:30: warning: initialization of ‘int *’ from ‘long unsigned int’ makes pointer from integer without a cast [-Wint-conversion]
    8 | #define kallsyms_lookup_name ((unsigned long(*)(const char *))kallsyms_lookup_name_address)
    | ^
    /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/kgdboe_io.c:163:30: note: in expansion of macro ‘kallsyms_lookup_name’
    163 | int *_gro_normal_batch = kallsyms_lookup_name(“gro_normal_batch”);
    | ^~~~~~~~~~~~~~~~~~~~
    /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/kgdboe_io.c:163:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    163 | int *_gro_normal_batch = kallsyms_lookup_name(“gro_normal_batch”);
    | ^~~
    In file included from /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/kgdboe_io.c:8:
    At top level:
    /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/tracewrapper.h:23:27: warning: ‘do_lookup_tracepoint’ defined but not used [-Wunused-function]
    23 | static struct tracepoint *do_lookup_tracepoint(const char *tracepointName, const char *tracepointPtrName)
    | ^~~~~~~~~~~~~~~~~~~~
    cc1: some warnings being treated as errors
    make[1]: *** [scripts/Makefile.build:297: /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8/kgdboe_io.o] Error 1
    make: *** [Makefile:1881: /tmp/kgdboe-b02afbe5-399e-4642-9ee8-71900ab73bb8] Error 2
    ————————–
    Command exited with code 2

     

     

    • This topic was modified 3 months, 2 weeks ago by  subvert.
    • This topic was modified 3 months, 2 weeks ago by  subvert.
    • This topic was modified 3 months, 2 weeks ago by  subvert.
    • This topic was modified 3 months, 2 weeks ago by  subvert.
    #33083

    support
    Keymaster

    Hi,

    The KGDBoE module relies on several APIs that slightly vary between different kernel versions (distro-specific patches make this even harder). You can try using the latest KGDBoE version from our repository – it works out-of-the-box with Ubuntu 22.04.

    That said, if you are new to Linux kernel development and do not wish to troubleshoot KGDBoE compatibility issues, we would advise using one of the supported virtual machine types with the VM-specific debugging interface. As the VM-based debugger runs outside of the kernel, it doesn’t need any special adjustment and usually just works out-of-the-box.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.