A compound of the formula: wherein: m is an integer from 0 to 6; R1 is hydrogen, trichloromethyl, trifluoromethyl, halogen, cyano, NR10R11, or straight or branched (C 1 -C 8) alkyl, wherein: R10 and R11 taken together with the atoms to which they are bonded form a heterocyclyl optionally containing one additional heteroatom or heteroatomic group selected from S, O, N and NH; X is -CH or N; R2 is hydrogen, halogen, or NR17R18, wherein: R17 and R18 are, each independently one from the other, hydrogen or a straight or branched (C 1 -C 8) alkyl optionally substituted with alkoxycarbonylamino; R3, R4, R5 and R6 are, each independently one from the other, hydrogen, halogen, trifluoromethyl, trichloromethyl, cyano, or a group selected from straight or branched (C 1 -C 8) alkyl and (C 3 -C 8) cycloalkyl, R7 is selected from straight or branched (C 1 -C 8) alkyl, (C 3 -C 8) cycloalkyl, and aryl, wherein the aryl is phenyl and R7 is optionally substituted with one or more substituents selected from halogen, (C 1 -C 5) alkyl, trifluoromethyl, and cyano; R8 is COR27 or CHR28OCOR29, wherein: R27 is straight or branched (C 1 -C 8) alkyl or a group OR30, wherein the straight or branched (C 1 -C 8) alkyl is optionally substituted with dialkylamino: R30 is straight or branched (C 1 -C 8) alkyl; R28 is hydrogen; R29 is straight or branched (C 1 -C 8) alkyl, aryl or a group NR31 R32, wherein the aryl is phenyl and the (C 1 -C 8) alkyl is optionally substituted with dialkylamino: R31 and R32 are, each independently one from the other straight or branched (C 1 -C 8) alkyl optionally substituted with alkoxycarbonyl; or a pharmaceutically acceptable salt thereof. m is an integer from 0 to 6; R1 is hydrogen, trichloromethyl, trifluoromethyl, halogen, cyano, NR10R11, or straight or branched (C 1 -C 8) alkyl, wherein: R10 and R11 taken together with the atoms to which they are bonded form a heterocyclyl optionally containing one additional heteroatom or heteroatomic group selected from S, O, N and NH; R10 and R11 taken together with the atoms to which they are bonded form a heterocyclyl optionally containing one additional heteroatom or heteroatomic group selected from S, O, N and NH; X is -CH or N; R2 is hydrogen, halogen, or NR17R18, wherein: R17 and R18 are, each independently one from the other, hydrogen or a straight or branched (C 1 -C 8) alkyl optionally substituted with alkoxycarbonylamino; R3, R4, R5 and R6 are, each independently one from the other, hydrogen, halogen, trifluoromethyl, trichloromethyl, cyano, or a group selected from straight or branched (C 1 -C 8) alkyl and (C 3 -C 8) cycloalkyl, R17 and R18 are, each independently one from the other, hydrogen or a straight or branched (C 1 -C 8) alkyl optionally substituted with alkoxycarbonylamino; R3, R4, R5 and R6 are, each independently one from the other, hydrogen, halogen, trifluoromethyl, trichloromethyl, cyano, or a group selected from straight or branched (C 1 -C 8) alkyl and (C 3 -C 8) cycloalkyl, R7 is selected from straight or branched (C 1 -C 8) alkyl, (C 3 -C 8) cycloalkyl, and aryl, wherein the aryl is phenyl and R7 is optionally substituted with one or more substituents selected from halogen, (C 1 -C 5) alkyl, trifluoromethyl, and cyano; R8 is COR27 or CHR28OCOR29, wherein: R27 is straight or branched (C 1 -C 8) alkyl or a group OR30, wherein the straight or branched (C 1 -C 8) alkyl is optionally substituted with dialkylamino: R30 is straight or branched (C 1 -C 8) alkyl; R28 is hydrogen; R29 is straight or branched (C 1 -C 8) alkyl, aryl or a group NR31 R32, wherein the aryl is phenyl and the (C 1 -C 8) alkyl is optionally substituted with dialkylamino: R31 and R32 are, each independently one from the other straight or branched (C 1 -C 8) alkyl optionally substituted with alkoxycarbonyl; or a pharmaceutically acceptable salt thereof. R27 is straight or branched (C 1 -C 8) alkyl or a group OR30, wherein the straight or branched (C 1 -C 8) alkyl is optionally substituted with dialkylamino: R30 is straight or branched (C 1 -C 8) alkyl; R28 is hydrogen; R29 is straight or branched (C 1 -C 8) alkyl, aryl or a group NR31 R32, wherein the aryl is phenyl and the (C 1 -C 8) alkyl is optionally substituted with dialkylamino: R31 and R32 are, each independently one from the other straight or branched (C 1 -C 8) alkyl optionally substituted with alkoxycarbonyl; or a pharmaceutically acceptable salt thereof. R30 is straight or branched (C 1 -C 8) alkyl; R28 is hydrogen; R29 is straight or branched (C 1 -C 8) alkyl, aryl or a group NR31 R32, wherein the aryl is phenyl and the (C 1 -C 8) alkyl is optionally substituted with dialkylamino: R31 and R32 are, each independently one from the other straight or branched (C 1 -C 8) alkyl optionally substituted with alkoxycarbonyl; or a pharmaceutically acceptable salt thereof.