This is the mail archive of the gdb@sourceware.org mailing list for the GDB 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]

How to ignore errors in user defined commands?


Hi,

when an error occures, the execution of a user define command
stops. How can I avoid this?

Background:
I use arm-elf-gdb-6.8 to debug my remote target. On some errors,
such as a crash of the target device, the remote protocol seems
to get out of sync and does not recover (I just get remote
protocol errors). When I try to reconnect via "target remote
<IP>" this fails with remote errors.

I just noticed while writing this mail that I'm unable to
reproduce it (in my tests now it recovers always).

However, when it does not recover an easy workaround is "tar re /x",
which leads to a "no such file or directory" and aborts. After
this, "target remote <IP>" works in any case.

The issue with that state is that here not everyone knows and
remembers this workaround, so I would like to automate that.

Since target remote is called by a user defined command (which
for example disables all breakpoints, otherwise my connect
attempts fail), I wanted to do:

defined trc
  target remote /x
  target remote $IP
  continue
end

but this already stops at the (intended) error at first
statement.

oki,

Steffen


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