Trying to debug assemly

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Trying to debug assemly

aprekates
I have a simp cpuid.s assemblied to cpuid.o and linked to create a 
cpuid executable.

In emacs i do :

M-x gdb

and i give as argument the cpuid path.

I get :

Reading symbols from
/home/chomwitt/Programming/Assembly/Blum/code/chap04/cpuid...done.
(gdb) Undefined command: "1-inferior-tty-set".  Try "help".
(gdb) Undefined command: "2-gdb-set".  Try "help".
(gdb) Undefined command: "3-gdb-set".  Try "help".
(gdb) Undefined command: "4-enable-pretty-printing".  Try "help".
(gdb) Undefined command: "5-file-list-exec-source-files".  Try "help".
(gdb) Undefined command: "6-file-list-exec-source-file".  Try "help".
(gdb) Undefined command: "7-gdb-show".  Try "help".
(gdb) Undefined command: "8-stack-info-frame".  Try "help".
(gdb) Undefined command: "9-thread-info".  Try "help".
(gdb) Undefined command: "10-break-list".  Try "help".
(gdb) Undefined command: "11-thread-info".  Try "help".
(gdb) Undefined command: "12-break-list".  Try "help"

(gdb)

What are those lines mean? Are those warnings or bugs?



Reply | Threaded
Open this post in threaded view
|

Re: Trying to debug assemly

Andrew Savonichev
aprekates <[hidden email]> writes:

> I have a simp cpuid.s assemblied to cpuid.o and linked to create a 
> cpuid executable.
>
> In emacs i do :
>
> M-x gdb
>
> and i give as argument the cpuid path.
>
> I get :
>
> Reading symbols from
> /home/chomwitt/Programming/Assembly/Blum/code/chap04/cpuid...done.
> (gdb) Undefined command: "1-inferior-tty-set".  Try "help".
> (gdb) Undefined command: "2-gdb-set".  Try "help".
>
> [...]
>
> What are those lines mean? Are those warnings or bugs?
>

M-x gdb gives you a default command `gdb -i=mi'. Make sure you don't
delete this `-i=mi' option, and just add a path to an executable:

  M-x gdb
  gdb -i=mi /path/to/cpuid

More about `-i=mi' option:
  https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI.html

--
Andrew

Reply | Threaded
Open this post in threaded view
|

Re: Trying to debug assemly

VanL
In reply to this post by aprekates
aprekates <[hidden email]> writes:

> (gdb) Undefined command: "1-inferior-tty-set".  Try "help".
> (gdb) Undefined command: "2-gdb-set".  Try "help".
> (gdb) Undefined command: "3-gdb-set".  Try "help".
> (gdb) Undefined command: "4-enable-pretty-printing".  Try "help".
> (gdb) Undefined command: "5-file-list-exec-source-files".  Try "help".
> (gdb) Undefined command: "6-file-list-exec-source-file".  Try "help".
> (gdb) Undefined command: "7-gdb-show".  Try "help".
> (gdb) Undefined command: "8-stack-info-frame".  Try "help".
> (gdb) Undefined command: "9-thread-info".  Try "help".
> (gdb) Undefined command: "10-break-list".  Try "help".
> (gdb) Undefined command: "11-thread-info".  Try "help".
> (gdb) Undefined command: "12-break-list".  Try "help"
>
> (gdb)
>
> What are those lines mean? Are those warnings or bugs?

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 gdb's mumble grumble      bellyache due to 'undefine command'  hint, do this
──────────────────────────────────────────────────────────────────────────────
 (gdb) Undefined command:  "1-inferior-tty-set".                Try "help".  
 (gdb) Undefined command:  "2-gdb-set".                         Try "help".  
 (gdb) Undefined command:  "3-gdb-set".                         Try "help".  
 (gdb) Undefined command:  "4-enable-pretty-printing".          Try "help".  
 (gdb) Undefined command:  "5-file-list-exec-source-files".     Try "help".  
 (gdb) Undefined command:  "6-file-list-exec-source-file".      Try "help".  
 (gdb) Undefined command:  "7-gdb-show".                        Try "help".  
 (gdb) Undefined command:  "8-stack-info-frame".                Try "help".  
 (gdb) Undefined command:  "9-thread-info".                     Try "help".  
 (gdb) Undefined command:  "10-break-list".                     Try "help".  
 (gdb) Undefined command:  "11-thread-info".                    Try "help".  
 (gdb) Undefined command:  "12-break-list".                     Try "help"    
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The gdb complains it has had undigestible 'undefined commands' on input feed?

And, suggests what to do about it by taiping 'help'.

--
VanL.
  əə0@ 一 二 三 言 語 𝔖 元 示 証 明 海 自 己 漢 本 人 Gnus/Emacs (berkeley-unix)



Reply | Threaded
Open this post in threaded view
|

Re: Trying to debug assemly

aprekates
In reply to this post by Andrew Savonichev
Thanks.

That worked. Although i dont quite understand what is the /GDB/MI
interface./

I  also enabled the option : GUD / GDB-MI / Display other windows

If i dont do that the other windows like breakpoints,registers etc wont
close when i give the gdb> quit but i have to M-x kill-buffer each one.

Alexandros

On 17/12/19 9:27 π.μ., Andrew Savonichev wrote:

> aprekates <[hidden email]> writes:
>> I have a simp cpuid.s assemblied to cpuid.o and linked to create a
>> cpuid executable.
>>
>> In emacs i do :
>>
>> M-x gdb
>>
>> and i give as argument the cpuid path.
>>
>> I get :
>>
>> Reading symbols from
>> /home/chomwitt/Programming/Assembly/Blum/code/chap04/cpuid...done.
>> (gdb) Undefined command: "1-inferior-tty-set".  Try "help".
>> (gdb) Undefined command: "2-gdb-set".  Try "help".
>>
>> [...]
>>
>> What are those lines mean? Are those warnings or bugs?
>>
> M-x gdb gives you a default command `gdb -i=mi'. Make sure you don't
> delete this `-i=mi' option, and just add a path to an executable:
>
>    M-x gdb
>    gdb -i=mi /path/to/cpuid
>
> More about `-i=mi' option:
>    https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI.html
>
Reply | Threaded
Open this post in threaded view
|

Re: Trying to debug assemly

Tomas Zerolo
On Wed, Dec 18, 2019 at 04:30:38AM +0200, aprekates wrote:
> Thanks.
>
> That worked. Although i dont quite understand what is the /GDB/MI
> interface./

GDB/MI is the so-called "machine interface". Back Then (TM), GDB was
just an interactive program: you type in things, GDB displays things
to you. With time, more-or-less graphical front ends appeared (among
them, of course, something written in Emacs). It became clear that
the interactive user interface wasn't the ideal way for a program to
control GDB, and thus MI was born.

Cheers
-- t

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Trying to debug assemly

aprekates
Thanks.

So if i want to debug in emacs with gdb and have ide like functionality
, giving me the ability to create breakpoint by clicking next to source
lines or windows with updates on variables, registers , memory region
etc then gdb must be able ta accept 'machine' like commands from the
emacs gdb frontent.

Alexandros.

GDB/MI

On 18/12/19 10:39 π.μ., [hidden email] wrote:

> On Wed, Dec 18, 2019 at 04:30:38AM +0200, aprekates wrote:
>> Thanks.
>>
>> That worked. Although i dont quite understand what is the /GDB/MI
>> interface./
> GDB/MI is the so-called "machine interface". Back Then (TM), GDB was
> just an interactive program: you type in things, GDB displays things
> to you. With time, more-or-less graphical front ends appeared (among
> them, of course, something written in Emacs). It became clear that
> the interactive user interface wasn't the ideal way for a program to
> control GDB, and thus MI was born.
>
> Cheers
> -- t

Reply | Threaded
Open this post in threaded view
|

Re: Trying to debug assemly

aprekates
|||I've learned about three ways to initiate a debugging session in 
emacs with gdb.|

||a.  M-x gud-gdb||

|||b.  M-x gdb|

|c.  M-x gdb  --interpreter=mi
|

|Does option a. uses GDB/MI interface?|

|Alexandros.
|

||

||

On 19/12/19 2:38 π.μ., aprekates wrote:

> Thanks.
>
> So if i want to debug in emacs with gdb and have ide like
> functionality , giving me the ability to create breakpoint by clicking
> next to source lines or windows with updates on variables, registers ,
> memory region etc then gdb must be able ta accept 'machine' like
> commands from the emacs gdb frontent.
>
> Alexandros.
>
> GDB/MI
>
> On 18/12/19 10:39 π.μ., [hidden email] wrote:
>> On Wed, Dec 18, 2019 at 04:30:38AM +0200, aprekates wrote:
>>> Thanks.
>>>
>>> That worked. Although i dont quite understand what is the /GDB/MI
>>> interface./
>> GDB/MI is the so-called "machine interface". Back Then (TM), GDB was
>> just an interactive program: you type in things, GDB displays things
>> to you. With time, more-or-less graphical front ends appeared (among
>> them, of course, something written in Emacs). It became clear that
>> the interactive user interface wasn't the ideal way for a program to
>> control GDB, and thus MI was born.
>>
>> Cheers
>> -- t
>