Hi Elazar,

Put some fprintfs into the code, start with main().
Save the output to a file.
This is a quick way to circumvent all the gdb hassle.
This requires some code understanding.

Example:
============== ce.h ================
#include <cstdio>

static char *cefilename = "ce.txt";

#define ceprintf(...) \
do { \
  FILE *dfp = fopen(cefilename, "a"); \
  fprintf(dfp, __VA_ARGS__); \
  fclose(dfp); \
} \
while (0)

================ End of ce.h ===============

LyX main() fuction:

#include <ce.h>

..
main() {
  ...
  ceprintf("Starting main()\n");
  ...
  ceprintf("Calling somefunc or somemethod.\n");
  someclass.somemethod(foo, bar);
  ceprintf("back from somemethod.\n");
  ...
}

=========================

Check ce.txt file in your cwd.

Moshe.

Elazar Leibovich wrote:
> Problem:
> I wish to hack and solve Bidirectionality related bugs in Lyx.
> However, I don't want to read all and understand all the code in Lyx,
> but only the code related to cursor movement, character insertion,
> etc.
> How can I find the relevant pieces of code quickly?
> Suggested Solution:
> Run Lyx with a debugger, have the debugger print constantly which
> functions from lyx sources (so that printf() wouldn't litter the
> output) are being called, now press left, and watch the execution
> flow, based on that locate the required code.
> 
> Is there any way to do that with gdb? Any other smart solution?
> 
> =================================================================
> To unsubscribe, send mail to [EMAIL PROTECTED] with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail [EMAIL PROTECTED]
> 

-- 
Moshe Gorohovsky

A6 CC A7 E1 C2 BD 8C 1B  30 8E A4 C3 4C 09 88 47   Tk Open Systems Ltd.
-----------------------------------------------------------------------
     - Tel: +972.2.679.5364, http://www.tkos.co.il -

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to