This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GDB and console (libc_stdio) on same serial port


George Sosnowski wrote:

GDB mode (ctrl-c, $, or possibly even some user command you give your
application) and when you want to switch do:

cyg_hal_user_break( (CYG_ADDRWORD *)hal_saved_interrupt_state );

You'll have to have defined these first:

#include <cyg/hal/hal_arch.h>
#include <cyg/hal/hal_misc.h>
extern struct Hal_SavedRegisters *hal_saved_interrupt_state;

I tried doing this, but initially gdb is spoken (i.e., $.....) on the
serial port. Is there a configuration option to disable gdb from the
serial port until I do the cyg_hal_user_break()? Or do I need to comment
out something from cyg_start? I'm using a configuration where the GDB
stubs are being included in the application.
Ah, presumably you're loading via GDB, then continuing, then disconnecting your GDB session, right?

You'll need to set a specific console channel using virtual vector calls. You'll need to look at the hal_diag.c for your target and (at a guess) do:

#include <cyg/hal/hal_if.h>

{
[...]
CYGACC_CALL_IF_SET_CONSOLE_COMM(0);

to set it to use the console channel 0, instead of the GDB channel which is defined in hal_if.h to be:

#define CYGNUM_CALL_IF_SET_COMM_ID_MANGLER -3

Jifl
--
eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts
--[ "You can complain because roses have thorns, or you ]--
--[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine


--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]