Help needed regarding LLDB/MI

Hello all,

I have started using LLDB/MI but there are some commands that are not working .I start the MI in terminal as “lldb-mi-3.6 --interpreter” and then launch the application that I want to debug but commands like “n” ,“list”,“continue” ,“step” are not working.There is this error message that gets displayed on giving these commands

"^error,msg=“Driver. Received command ‘command_name’. It was not handled. Command ‘continue’ not in Command Factory”

I tried looking for the substitutes of these commands here https://github.com/llvm-mirror/lldb/tree/7535162178eada833e72a5525fc26dcc04e7331e/tools/lldb-mi but could not find any.

Could anyone please help me out with this?

Thank you :slight_smile:

Rishabh

Hi Rishabh,

It looks like you’re trying to use lldb commands when running lldb-mi. lldb-mi is the gdb-mi command layer on top of lldb, primarily used by tools like Eclipse to talk to lldb or gdb using a similar command set. These commands are documented here: https://sourceware.org/gdb/onlinedocs/gdb/Remote-Protocol.html .

If you’re interested in running the lldb command line debugger, don’t start MI, but just lldb, with “lldb”.

Ted

Hello all,

I have started using LLDB/MI but there are some commands that are not working .I start the MI in terminal as "lldb-mi-3.6 --interpreter" and then launch the application that I want to debug but commands like "n" ,"list","continue" ,"step" are not working.There is this error message that gets displayed on giving these commands

"^error,msg="Driver. Received command 'command_name'. It was not handled. Command 'continue' not in Command Factory"

Was this something you were typing at a "(gdb)" prompt? If not, it sounds like your software is using GDB commands instead of using the actual MI commands and the best solutions is to fix your software to actually use the MI commands instead of sending GDB command interpreter commands.

I believe there is some way to send a gdb command line command, so if you have a "(gdb) " prompt, and we will pass the command along to LLDB.

I tried looking for the substitutes of these commands here https://github.com/llvm-mirror/lldb/tree/7535162178eada833e72a5525fc26dcc04e7331e/tools/lldb-mi but could not find any.

Could anyone please help me out with this?

So check if your IDE is not actually using MI. Your IDE shouldn't send a "continue" GDB command interpreter command, but it should send an "exec-continue" MI packet since you are using MI. Don't sent a "n" packet, but send a "exec-next" packet. Etc...

Let me know what your IDE is doing.

Greg

>
> Hello all,
>
> I have started using LLDB/MI but there are some commands that are not
working .I start the MI in terminal as "lldb-mi-3.6 --interpreter" and then
launch the application that I want to debug but commands like "n"
,"list","continue" ,"step" are not working.There is this error message that
gets displayed on giving these commands
>
> "^error,msg="Driver. Received command 'command_name'. It was not
handled. Command 'continue' not in Command Factory"

Was this something you were typing at a "(gdb)" prompt?

Yes

If not, it sounds like your software is using GDB commands instead of
using the actual MI commands and the best solutions is to fix your software
to actually use the MI commands instead of sending GDB command interpreter
commands.

I believe there is some way to send a gdb command line command, so if you
have a "(gdb) " prompt, and we will pass the command along to LLDB.
>
> I tried looking for the substitutes of these commands here
https://github.com/llvm-mirror/lldb/tree/7535162178eada833e72a5525fc26dcc04e7331e/tools/lldb-mi
but could not find any.
>
> Could anyone please help me out with this?

So check if your IDE is not actually using MI. Your IDE shouldn't send a
"continue" GDB command interpreter command, but it should send an
"exec-continue" MI packet since you are using MI. Don't sent a "n" packet,
but send a "exec-next" packet. Etc...

till now I have been using the MI in the terminal itself .I figured out the
corresponding MI commands for 'n','step','continue' but not for 'list'.

The thing is GDB/MI commands listed here
GDB/MI (Debugging with GDB) don't
just work outside the box when used with LLDB/MI .for example:

1.In GDB/MI -exec-next commands works fine but to make it work for LLDB/MI
we need to provide the thread number ,so the command becomes "-exec-next
--thread 1"

2.-var-update command ,In GDB/MI "-var-update *" works fine but the same
command in LLDB/MI gives
"^error,msg="Command 'var-update'. Variable '*' does not exist"

So it takes time to figure out the correct usage of the command

Let me know what your IDE is doing.

They are implementing the MI only

Greg

Thanks

Hi Rishabh,

Hi Ted,

It looks like you’re trying to use lldb commands when running lldb-mi.
lldb-mi is the gdb-mi command layer on top of lldb, primarily used by tools
like Eclipse to talk to lldb or gdb using a similar command set. These
commands are documented here:
Remote Protocol (Debugging with GDB) .

I was aware that commands like "n","list" are all Non MI commands .I was
actually looking for their corresponding commands for which I found
GDB/MI (Debugging with GDB) page
more helpful.
Thanks :slight_smile:

Please file bugs where the lldb implementation of the MI doesn't support features documented in the GDB MI documentation.

Jim